I noticed last week on a VM (FreeBSD as guest on VirtualBox, efi boot) that the boot environment didn't work when you select it on the beasty menu. The kernel runs until it comes to mount root. Then, you read "internal error: failed to initialize ZFS library". After that, it seems that the ZFS root filesystem remains read-only. You can imagine easily that it crashes soon after because there is no device in /dev for example.
But, if you activate a BE with beadm (for instance) and reboot, all is working well.
I even experimented no boot at all with efi but cannot tell the exact circonstances.
I eventually understood where the problem lies. To tell the story briefly, I came from FreeBSD 12.0 (or before) and never updated this essential efi file, I mean /efi/boot/BOOTx64.efi.
My previous BOOTx64. efi: 393216 bytes.
The 12.1 loader.efi: 460800 bytes (no problem with 12.2).
The 12.2 loader.efi: 488960 bytes.
So, at each OS upgrade, even minor, do something like that:
drive-name-partition is often ada0p1 but you have to look where the efi partition lies with
But, if you activate a BE with beadm (for instance) and reboot, all is working well.
I even experimented no boot at all with efi but cannot tell the exact circonstances.
I eventually understood where the problem lies. To tell the story briefly, I came from FreeBSD 12.0 (or before) and never updated this essential efi file, I mean /efi/boot/BOOTx64.efi.
My previous BOOTx64. efi: 393216 bytes.
The 12.1 loader.efi: 460800 bytes (no problem with 12.2).
The 12.2 loader.efi: 488960 bytes.
So, at each OS upgrade, even minor, do something like that:
mount -t msdosfs /dev/drive-name-partition /mnt
cp /boot/loader.efi /mnt/efi/boot/BOOTx64.efi
drive-name-partition is often ada0p1 but you have to look where the efi partition lies with
gpart show
.