Re: zpool upgrade and bootcode on 13-RELEASE

From: Kurt Jaeger <>
Date: Wed, 19 May 2021 17:09:06 UTC

> Does this mean, re-installing the bootcode isn't necessary anymore - or
> has the warning been removed by accident/as a side effect of merging
> with OpenZFS?

On the contrary, because of the switch from FreeBSD ZFS to
OpenZFS, the bootcodes needs to be updated! It's unfortunate
that no message is displayed 8-(

The problem is, finding out which bootcode needs to go where etc.

It depends if your system boots from the EFI partition or
from the freebsd-boot partition. And how your system is

I have some notes for gpart filesystems:

- check with
  gpart show
  This system has both (!):
  partition 1 is efi
  partition 2 is legacy boot
=>        40  4000797280  ada0  GPT  (1.9T)
          40      409600     1  efi  (200M)
      409640        1024     2  freebsd-boot  (512K)
      410664         984        - free -  (492K)
      411648    18874368     3  freebsd-swap  (9.0G)
    19286016  3981510656     4  freebsd-zfs  (1.9T)
  4000796672         648        - free -  (324K)

- To update the EFI:
  mount -t msdos /dev/ada0p1 /mnt
  cd /mnt/efi/boot
  mv BOOTx64.efi BOOTx64.efi-old
  cp /boot/loader.efi BOOTx64.efi
  cd /
  umount /mnt

- To update the legacy boot:

  gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada0

- If efi is not mountable ? create a msdosfs:
  newfs_msdos /dev/ada0p1
  mount -t msdos /dev/ada0p1 /mnt
  mkdir /mnt/efi/boot
  cp /boot/loader.efi /mnt/efi/boot/BOOTx64.efi
  umount /mnt

--            +49 171 3101372                    Now what ?