root on zfs can be awesome. Just something as simple as snapshot’ing before doing updates can be a lifesaver. Combined with zfsbootmenu to allow easy rollbacks or cloning, and it’s - what’s the phrase ? Slicker-n snot on a doorknob
It’s definitely more work to get set up though. And agreed, the Canonical way of root-on-zfs feels cumbersome.
There are a few ways of handling backups/replication. Sanoid/Syncoid is one that seems highly regarded, though I haven’t used it myself. Older setup of zfs-auto-snapshot (zfsonlinux/zfs-auto-snapshot) and zfs-backup (adaugherity/zfs-backup) works well, and I use that on my main media box. I’ve become fond of zrepl (zrepl/zrepl) and have that working on most systems.
Shameless plug - I have my own opinionated root-on-zfs setup (GitHub - Halfwalker/ZFS-root: Set up root-on-zfs using whole disk, with dracut and zfsbootmenu) that builds a system using zfsbootmenu, dracut (instead of initramfstools), rEFInd (instead of efibootmgr), with optional LUKS or native zfs encryption. This is what I use to build all my own systems, from servers to workstations to laptops. There are several other similar examples out there - check them out and pick one if it feels right.
As for datasets, think about the type of data to go in them. Large files like videos ? Use a larger blockside. Running a database ? There are specific tuning params to consider. Datasets are cheap - break up your data in logical chunks, keeping in mind what kind of data, how important, how often to snapshot/replication etc., what kind of throughput you might need (VMs ? docker/kubernetes ?)
For example, my home dataset is snapshot’d every 15mins.
Keep 4x 15min snaps (so the last hour at 15min intervals)
Keep 24x hourly snaps
Keep 30x daily snaps
Keep 12x monthly snaps
Root dataset is also snapshot’d every 15mins but only if more than 2meg has changed on the dataset. That keeps the number of snaps down somewhat. Also, everytime apt install
is called, a hook run a snapshot before the install, making it easy to rollback to pre-install of any new/updated stuff.
zrepl manages those snapshots and replicates them to a 2nd device on the box.
A neat utility httm
makes it easy to search back through snapshots.
I’ve had instances when Sonarr has “updated” some shows, totally borking them in the process. And I don’t find out for 6 months or more. Mount the snapshot from 7 months ago with sudo mount -t zfs <snapshot> /mnt
and copy the old files back. Boom, done.
The backup box with 24 old drives has 2 years of replication backups. I’ve only had to pull from that twice in the last 6 years or so. But boy I was glad it was there …