Home Server – setting up ZFS (revisited)

Finally, after two years of renovations and two children, I am revisiting the idea of a small home server. I don’t expect it to do much:

  • Media server
  • File backup
  • Some docker containers
  • Grafana
  • Possibly pfSense or another firewall

Whenever I’m accessing a remote system (even when using SSH in my internal network) I prefer to start a TMUX session. That way, if I get disconnected (for instance) during the middle of a package upgrade, that process just continues and I can reconnect at a later time without issues (if tmux is not yet installed or you’re not using it yet, I highly recommend reading up on it and taking a bit of time to get used to the basic concepts. I used this quickstart a couple of years ago).

tmux new -s sessionname

Install the required zfs package:

sudo apt update && sudo apt install zfsutils-linux

Then find out which drives you want to use:

sudo fdisk -l

In my case, I wanted to use the two 1.8GB drives (/dev/sdb and /dev/sdc) in a mirror configuration. I don’t have a hundred movies to fill a drive, most space will be taken up by photos and system images.

sudo zpool create mypool mirror /dev/sdb /dev/sdc

Check the pool status to verify that it is as intended:

zpool status

The pool automatically gets mounted on /mypool with root:root as owner. I changed the owner/group to my own user

sudo chown <user>:<user> /mypool/ (replace <user>)