In this tutorial, we will build a NAS using a variety of old hardware and the open-source storage solution Ceph. Follow along with the video and the steps below.
[00:00 - 00:02] I'm building a NAS with all of this: A bunch of junk and spare parts I found in my storage closet. A couple old laptops, a Zima board, a Ugreen NAS, a TerraMaster NAS, an old Dell server, a pile of random servers and hard drives, and a few Raspberry Pi's.
[00:21 - 00:24] With an open-source magic technology called Ceph. It's software-defined storage and it's crazy.
- CPU: ARM or x86
- RAM: Minimum 4GB
- Storage: External or internal hard drives/SSDs (USB flash drives are not recommended)
- Network Switch: At least 1 Gigabit for lab, higher for production
- OS: Ubuntu 22.04 (Use 20.04 for Raspberry Pi with Reef 18.2.2)
- Additional Tools: SSH, Docker, LVM2
-
Install Ubuntu 22.04 on all hosts.
-
Install SSH server:
sudo apt install openssh-server
-
Set static IP address in
netplan
configuration:cd /etc/netplan sudo nano your-config.yaml
-
Update and upgrade system:
sudo apt update sudo apt upgrade -y
-
Set a password for the root user:
sudo passwd root
-
Enable SSH login for the root user:
sudo nano /etc/ssh/sshd_config # Un-comment and set "PermitRootLogin yes" sudo systemctl restart ssh
-
Identify storage devices:
lsblk
-
Wipe storage devices:
sudo sgdisk --zap-all /dev/sdX sudo wipefs --all /dev/sdX
-
Install Docker:
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh ## refer to this link: https://docs.docker.com/engine/install/ubuntu/
-
Install LVM2:
sudo apt install lvm2
-
Verify time synchronization:
timedatectl status
-
Set environment variable:
export CEPH_RELEASE=18.2.2
-
Download and install CephADM:
curl -o cephadm https://raw.githubusercontent.com/ceph/ceph/${CEPH_RELEASE}/src/cephadm/cephadm chmod +x cephadm sudo ./cephadm add-repo --release ${CEPH_RELEASE} sudo ./cephadm install
-
Bootstrap Ceph:
sudo cephadm bootstrap --mon-ip <Manager-IP>
-
Copy SSH keys to hosts:
ssh-copy-id root@<host-ip>
-
Add hosts to the Ceph cluster:
sudo ceph orch host add <host-name> <host-ip>
-
List available devices:
ceph orch device ls
-
Add all available devices as OSDs:
ceph orch apply osd --all-available-devices
-
Create Ceph file system:
ceph fs volume create cephfs
-
Mount CephFS on Linux:
mkdir -p /mnt/ceph mount -t ceph <mon-ip>:6789:/ /mnt/ceph
-
Install and configure Samba for Windows access:
sudo apt install samba
[41:00 - End] Enjoy your new Ceph-powered FrankeNASS!