Aah, ZFS-root – it’s just wonderful: please indulge me as I wax lyrical about how hugely useful this actually is for a bit ?
I’d updated my system
as per the instructions Tabriz put together and for the most part, everything just worked – I had a root filesystem on ZFS and life was good.
The really fun bit came earlier today when I was doing the sort of messing about that you do on a Friday afternoon – in my case, I’d decided to clone the root filesystem, and was experimenting with
pkgrm -R of the existing packages on that clone and then using
pkgadd -R with updated packages to see if it would be a “poor man’s LiveUpgrade”.
Of course, that didn’t work – all sorts of things went wrong (as I sort of expected they might) : after fixing /etc/system and /etc/vfstab to point to the newly created clone, my system didn’t boot properly, probably because post-install scripts were executing against the existing system, though don’t quote me on that diagnosis – I didn’t investigate thoroughly what was going on – suffice to say, it didn’t work with the minimal effort I’d put into it and I was left with a warm brick.
But, this is ZFS, right ? So, a boot back into my UFS-rooted system, and a quick utterance of
zfs rollback /tank/root_filesystem@original and I was back in business! Fantastic!
Of course, I can see utility here for things other than just protection from sys-admins who’ve gone postal (like I had)
All sorts of system administration becomes easier now. Want to see the effects of adding a new package, without risking your existing system, or having to spend time backing up/restoring data, or patching something to see if you like the new behaviour, or installing software where you don’t trust the packaging system (I’m looking at you “configure; make ; make install” !) — zfs snapshot/rollback on the root filesystem is the answer.
Now, if only we could snapshot/rollback a live-root partition without having to reboot : I can’t imagine how that could work – but definitely something I’d be interested in.
So, to sum up – you really should investigate running ZFS as your root filesystem: I’ve tried it and just like my moving all my data to ZFS, I’m not going back.
Update: You may also be interested in a script I wrote after posting this, to automate installs of ZFS mountroot