bootloader problem since i update from 12.1 to 12.2 zfs reddit / freebsd ---------------------------------------------------------------------- kristoferus · 2021-02-09 12:54 Hi ! After upgrade 12.1 to 12.2 i get an error because of zfs -> so i need to update zfs but after that i need to set this (zfs mirror): `gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0` `gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da1` But now after reboot of the server it wont boot i dont know but i thing after i set to legacy boot the server boots again :-( How can i set it back to UEFI boot ? What i did wrong ? thanks `# gpart show` `=> 40 468862048 da0 GPT (224G)` `40 409600 1 efi (200M)` `409640 1024 2 freebsd-boot (512K)` `410664 984 - free - (492K)` `411648 8388608 3 freebsd-swap (4.0G)` `8800256 460060672 4 freebsd-zfs (219G)` `468860928 1160 - free - (580K)` ​ `=> 40 468862048 da1 GPT (224G)` `40 409600 1 efi (200M)` `409640 1024 2 freebsd-boot (512K)` `410664 984 - free - (492K)` `411648 8388608 3 freebsd-swap (4.0G)` `8800256 460060672 4 freebsd-zfs (219G)` `468860928 1160 - free - (580K)` ​ Is this correct in my case to fix it: `gpart bootcode -p /boot/boot1.efifat -i 1 ada0` `gpart bootcode -p /boot/boot1.efifat -i 1 ada1` `gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada0` `gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada1` ---------------------------------------------------------------------- [deleted] · 2021-02-09 14:34 [deleted] ---------------------------------------------------------------------- dddddavidddd · 2021-02-09 17:08 I once did something like this. To fix it, I booted from an installer USB and copied over its EFI partition to recreate / repair mine. ---------------------------------------------------------------------- _jo_ku · 2021-02-10 11:56 The problem is that you wrote the protective MBR (relevant for BIOS boot) to the rootsector of your disk with this command `gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0`, but you actually want to start your machine in UEFI mode. To update your bootloader on the ESP (UEFI) you can use this command (`gparted show` says your disk is `da0` and `efi` is located on sector `1`): ``` gpart bootcode -p /boot/boot1.efifat -i 1 da0 ``` Note: It's sufficient to run the command on `da0` only. As you use a zfs-mirror, your data will be mirrored anyway. ---------------------------------------------------------------------- kristoferus · 2021-02-11 09:42 thanks !