[Howto] update the ZFS bootcode after zfs-update

posted in: computer | 0

problem:
you can’t boot from zfs-boot, because of a version mismatch between old bootloader-code and upgraded zfs-version.

ZFS: unsupported feature: com.delphix:head_errlog
ZFS: pool 'foo' is not supported

Can't find /boot/zfsloader
Cant' find /boot/loader

reason:
you have upgraded your bootable zpool to a new zfs-version with new enabled features, but you have forgotten to upgrade the corresponding zfs bootloader-code on disks.

Pool 'foo' has the bootfs property set, you might need to update the boot code.
See gptzfsboot(8) and loader.efi(8) for details.

solution:
install the updated zfs-bootcode-files pmbr, gptzfsboot to your disks.
(you have to select the correct disk, ‘da0’ is only a example)

gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0

tipp:
you can do this work from a bootable live-system on a usb-stick (with the newest version, for example: FreeBSD-14.0-RELEASE-amd64-memstick.img). Boot the live-system, select console, copy the new bootcode-files to your disks with the command from above.