Basics:
- pool/root-version is for a given OS version
- pool/root-all is for data independent of OS version
- pool/tld is for new top-level directories - use your judgment
Each upgrade uses the following sequence:
- Snapshot all filesystems
zfs snapshot -r mtumishi/root-8.2p2@2011-10-29_20:00:00
- Clone the snapshots to the new version
zfs clone mtumishi/root-8.2p2@2011-10-29_20:00:00 mtumishi/root-8.2p4 zfs clone mtumishi/root-8.2p2/tmp@2011-10-29_20:00:00 mtumishi/root-8.2p4/tmp ...
- Perform upgrade
mergemaster -pd /zfs/mtumishi/root-8.2p4 make installworld DESTDIR=/zfs/mtumishi/root-8.2p4 make installkernel DESTDIR=/zfs/mtumishi/root-8.2p4 mergemaster -d /zfs/mtumishi/root-8.2p4
- Point to the new install
echo 'vfs.root.mountfrom="zfs:mtumishi/root8.2p4"' >> /zfs/mtumishi/root-8.2p4/boot/loader.conf sed -i~ 's/^mtumishi\/root-8.2p2/mtumishi\/root-8.2p4/g' /zfs/mtumishi/root-8.2p4/etc/fstab zpool set bootfs=mtumishi/root-8.2p4 mtumishi
- Hide mountpoints
zfs set mountpoint=legacy mtumishi/root-8.2p4
- Reboot to test!
Notes:
- It may be useful to place /usr and /usr/local on separate datasets, so you can snapshot before a port upgrade without having to snapshot all of /usr and / as well
NAME USED AVAIL REFER MOUNTPOINT mtumishi 2.73G 214G 24K /zfs/mtumishi mtumishi/home 21.1M 214G 21.1M /home mtumishi/obj 875M 214G 875M /usr/obj mtumishi/ports 170M 214G 170M /usr/ports mtumishi/root-8.2p2 426M 214G 423M legacy mtumishi/root-8.2p2/tmp 94.5K 214G 66.5K legacy mtumishi/root-8.2p2/var 1.86M 214G 1.67M legacy mtumishi/root-8.2p2/var/crash 22.5K 214G 22.5K legacy mtumishi/root-8.2p2/var/empty 21K 214G 21K legacy mtumishi/root-8.2p2/var/tmp 44K 214G 23K legacy mtumishi/root-8.2p4 256M 214G 423M legacy mtumishi/root-8.2p4/tmp 34K 214G 66.5K legacy mtumishi/root-8.2p4/var 57K 214G 21K legacy mtumishi/root-8.2p4/var/crash 16K 214G 22.5K legacy mtumishi/root-8.2p4/var/tmp 20K 214G 23K legacy mtumishi/root-all 45.6M 214G 22K legacy mtumishi/root-all/var 45.6M 214G 1.69M /var mtumishi/root-all/var/empty 15K 214G 21K /var/empty mtumishi/root-all/var/log 194K 214G 194K /var/log mtumishi/root-all/var/ports 45.2M 214G 24K /var/ports mtumishi/root-all/var/ports/distfiles 45.1M 214G 45.1M /var/ports/distfiles mtumishi/root-all/var/ports/packages 21K 214G 21K /var/ports/packages mtumishi/src 293M 214G 293M /usr/src mtumishi/srv 354M 214G 25K /srv mtumishi/srv/iscsi 21K 214G 21K /srv/iscsi mtumishi/srv/jail 21K 214G 21K /srv/jail mtumishi/srv/srcs 353M 214G 23K /srv/srcs mtumishi/srv/srcs/freebsd 353M 214G 23K /srv/srcs/freebsd mtumishi/srv/srcs/freebsd/9 353M 214G 353M /srv/srcs/freebsd/9