Ramblings of an aging IT geek
← Ramblings of an aging IT geek
linux

moving root onto zfs and not regretting it

A short account of rebuilding a workstation with root on ZFS for the boot environments and snapshots, and the one gotcha worth knowing about beforehand.

A terminal showing zpool status output

I rebuilt my workstation this weekend with root on ZFS, something I'd put off for years on the assumption it would be fiddly. It was a bit fiddly, but the thing I actually wanted, cheap snapshots before every risky change, has already paid for the effort twice.

The pitch is simple. Before a kernel upgrade, a zfs snapshot rpool/ROOT/default@before-upgrade costs nothing and takes no space until things diverge. When the upgrade goes sideways, and one did, a rollback puts you back exactly where you were in seconds, not a restore-from-backup afternoon. Boot environments make that even nicer: each is a separate dataset you can boot into, so a bad change never strands you.

The one gotcha worth flagging: ZFS is not in the mainline kernel and never will be, for licence reasons, so a kernel that ships faster than the ZFS module gets packaged can leave you unable to mount root. Pin your kernel, or stay a step behind, or use a distribution that handles the ordering for you. Get that wrong and snapshots won't help, because you can't boot far enough to roll back. Plan for it and root on ZFS is one of those changes you stop noticing precisely because it stops biting you.