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

Moving Root Onto ZFS

Reinstalling my main machine with root on ZFS, and why boot environments are the feature I actually wanted all along.

A Linux terminal glowing on a dark desk

I finally reinstalled my main machine with root on ZFS instead of ext4 on LVM, and the thing that sold me wasn't checksums or compression, useful as both are. It was boot environments.

The idea is simple and I'm cross I didn't do it years ago. Before a risky upgrade you snapshot the root dataset and clone it into a new bootable environment. If the upgrade goes well, carry on. If it eats your graphics stack or leaves you at a black screen, you reboot, pick the previous environment from the boot menu, and you're back exactly where you were in under a minute. No restore, no faff, no live USB.

zfs snapshot rpool/ROOT/default@before-upgrade

That one command is the safety net I used to fake with full backups and crossed fingers.

Compression I left on lz4 and forgot about; it costs nothing and quietly saves space. The genuine cost is RAM and a bit of care at install time, since getting ZFS to boot reliably still takes more attention than the average distro installer gives you. But for a machine I actually depend on, the ability to undo a bad day with a reboot is worth every minute of the setup. Should have done it sooner.