I don't think that this is hijacking the thread, since it's essentially the same subject... I am grateful to all contributors, and seek comments for some follow-on questions.
I want to upgrade my FreeBSD 12.2 ZFS server (with ZFS root) to FreeBSD 13.
The
Klara System site has some detailed instructions for upgrading from FreeBSD 12 to 13 using ZFS boot environments. This plan is pretty much straight from them:
Code:
bectl list
sudo bectl create FreeBSD13
sudo bectl mount FreeBSD13
mount | grep FreeBSD13 | cut -d' ' -f3 # ==> /tmp/be_mount.nOCj
freebsd-update -b /tmp/be_mount.nOCj -d /tmp/be_mount.nOCj/var/db/freebsd-update
-r 13.0-RELEASE upgrade
freebsd-update -b /tmp/be_mount.nOCj -d /tmp/be_mount.nOCj/var/db/freebsd-update
-r 13.0-RELEASE install
# Temporary activation
bectl activate -t FreeBSD13
# Complete the installation
freebsd-update install
# Commit to use it
bectl activate FreeBSD13
Vermaden's plan covers the same process, but is sufficiently different to be worth discussing.
It uses a
chroot(8) and therefore needs to mount
devfs(8). It does some other things that I need to clarify:
- deletes old patches in /var/db/freebsd-update (not sure why)
- runs "freebsd-update install" three times (Klara only do it twice)
- runs "pkg upgrade" which is fine, but I think could be deferred until FreeBSD13 is running.
The default ZFS installation (Guided Root-on-ZFS) installs on a GPT (BIOS) partition by default, so I don't have a UEFI boot partition. I am not sure if the
loader(8) changes mentioned by
vermaden are required.
The ZFS production server root is installed as ZFS mirror:
Code:
[sherman.149] $ zfs list zroot
NAME USED AVAIL REFER MOUNTPOINT
zroot 14.9G 194G 88K /zroot
[sherman.150] $ zpool status zroot
pool: zroot
state: ONLINE
scan: scrub repaired 0 in 0 days 00:00:54 with 0 errors on Sun Aug 8 03:02:38
2021
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
ada1p3 ONLINE 0 0 0
ada0p3 ONLINE 0 0 0
errors: No known data errors
[sherman.151] $ gpart show
=> 40 488397088 ada0 GPT (233G)
40 1024 1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 33554432 2 freebsd-swap (16G)
33556480 454840320 3 freebsd-zfs (217G)
488396800 328 - free - (164K)
=> 40 488397088 ada1 GPT (233G)
40 1024 1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 33554432 2 freebsd-swap (16G)
33556480 454840320 3 freebsd-zfs (217G)
488396800 328 - free - (164K)
[sherman.154] $ gmirror status
Name Status Components
mirror/swap COMPLETE ada0p2 (ACTIVE)
ada1p2 (ACTIVE)
So
gmirror(8) is mirroring the swap on slice 2, and
zfs(8) is mirroring slice 3. Nothing is mirroring slice 1 (freebsd-boot). So if I make changes there, I expect that they will have to be manually duplicated.
Will I need to change anything in /boot?
It
seems likely that if I need to update the boot code, then this would be appropriate (taking
/boot/gptzfsboot from a FreeBSD 13 system):
Code:
/sbin/gpart bootcode -p /boot/gptzfsboot -i 1 ada0
/sbin/gpart bootcode -p /boot/gptzfsboot -i 1 ada1
sum(1) tells me that
/boot/gptzfsboot differs from FreeBSD 12 to FreeBSD 13.