Solaris live upgrade like FreeBSD ZFS-rootfs update

Philipp Wuensche cryx-freebsd at
Thu Jan 29 14:41:49 PST 2009

David Schultz wrote:
> But since both ZFS and UFS support snapshots now, it would be
> great if the process were something like:
>   - drop to single user mode
>   - take snapshots of / and /usr
>   - install everything
>   - reboot
> But if something goes wrong, only ZFS has the ability to roll back
> to the last snapshot, and even then I'm not sure if you can
> actually boot from that snapshot in order to recover.

You can't boot from a snapshot, but you can boot off a cloned filesystem
and that is more or less what this script does.

- It creates a snapshot of your known-good root-filesystem
- It clones this snapshot into a new root-filesystem (requiring no
additional disc-space!) which you then update to the new freebsd version
- It configures the zpool to boot from the new root-filesystem

The known-good root-filesystem is not touched in any way and in case
anything goes wrong you can still boot from it.

As of now we can't select a root-filesystem in the loader to load kernel
and userland from, so it still involves two reboots to be able to go
back to the known-good root-filesystem without getting stuck in a broken
kernel or userland.
This is due to the fact that the loader currently blindly loads the
kernel from the root-filesystem configured in the zpool bootfs property
and if this kernel is broken or the userland you would boot from this
filesystem is damaged, you are screwed as you are not able to set the
bootfs property back to the known-good root-filesystem.

If we could select a root-filesystem in the loader it would be down to
one reboot without any drop to single-user or risk getting stuck in an
unusable system.


More information about the freebsd-current mailing list