Skip to content

Instantly share code, notes, and snippets.

@halcyon
Created April 4, 2024 15:25
Show Gist options
  • Save halcyon/21b55aef56c199cd441816828fe3fe72 to your computer and use it in GitHub Desktop.
Save halcyon/21b55aef56c199cd441816828fe3fe72 to your computer and use it in GitHub Desktop.
How to update fbsd bootcode
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
partitioned.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment