# After upgrade 12.1 to 12.2 boot problem zfs



## kristoferus75 (Feb 9, 2021)

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 ?

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
```


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)
```


----------



## SirDice (Feb 9, 2021)

kristoferus75 said:


> Is this correct in my case to fix it:


Looking at your partition tables, yes. The first commands you did overwrote the efi partition with the wrong boot code. The original freebsd-boot partition was still intact, that's why a CSM boot worked.


----------



## kristoferus75 (Feb 10, 2021)

solved


----------

