# Unable to boot freshly installed FreeBSD UEFI



## beast1e (Nov 29, 2020)

Hello! I installed FreeBSD on my UEFI computer with ZFS and GPT partition table (UEFI+GPT only), and it doesn't boot. The PC's UEFI doesn't find the freebsd's efi file (it says no active partition) so I am unable to boot it at all. Any suggestions how I can mark the efi partition as active? I already have booted from the installation DVD but I am not sure what exactly to do.


----------



## wbq (Nov 29, 2020)

I do not think, I can really help, but yesterday the auto installation setup failed for me, maybe it is a similiar issue for you:
I tried to setup a test setup and used the root on zfs auto installer, after setting up the partitions (in my case I chose UEFI+Bios option) 1. Efi boot partition, 2. freebsd-boot, 3. freebsd-zfs, the installer just exited and the computer restarted, it never got past that step to start the installation.

Are you sure, that the installer finished successfully? If it did, your UEFI should autodetect the bootloader in <efi-partition>: EFI/BOOT/BOOTX64.efi

If it is only about setting an entry to active, you can use the efibootmgr tool (https://www.freebsd.org/cgi/man.cgi?query=efibootmgr&sektion=8&manpath=freebsd-release-ports)


----------



## Emrion (Nov 29, 2020)

There isn't really a notion of active partion in GPT scheme (and so it is in EFI booting). Your system is probably trying to boot in BIOS mode. Inspect the settings of your BIOS.


----------



## beast1e (Nov 30, 2020)

wbq said:


> I do not think, I can really help, but yesterday the auto installation setup failed for me, maybe it is a similiar issue for you:
> I tried to setup a test setup and used the root on zfs auto installer, after setting up the partitions (in my case I chose UEFI+Bios option) 1. Efi boot partition, 2. freebsd-boot, 3. freebsd-zfs, the installer just exited and the computer restarted, it never got past that step to start the installation.
> 
> Are you sure, that the installer finished successfully? If it did, your UEFI should autodetect the bootloader in <efi-partition>: EFI/BOOT/BOOTX64.efi
> ...


I am pretty sure that the installer finished successfully! Thank you, I will try that out or I will just reinstall FreeBSD with BIOS boot partition.


----------



## beast1e (Nov 30, 2020)

Emrion said:


> There isn't really a notion of active partion in GPT scheme (and so it is in EFI booting). Your system is probably trying to boot in BIOS mode. Inspect the settings of your BIOS.


I understand! Honestly, I think my PC's UEFI is at fault in some way. I already have installed FreeBSD on a UEFI laptop and it automatically detects the efi file and it boots without problems. But I'm more than sure that my PC's settings are set correctly to boot as UEFI and not BIOS.


----------



## SirDice (Nov 30, 2020)

Some BIOS/UEFI implementations switch to CSM mode automatically if they find a boot sector on the disk. I would suggesting using the BIOS+UEFI installation option. That way it can boot in all cases.


----------



## beast1e (Dec 1, 2020)

SirDice said:


> Some BIOS/UEFI implementations switch to CSM mode automatically if they find a boot sector on the disk. I would suggesting using the BIOS+UEFI installation option. That way it can boot in all cases.


I understand. I assume this is what happens. It boots without any problems when using the BIOS installation option!


----------



## SirDice (Dec 1, 2020)

beast1e said:


> I understand. I assume this is what happens. It boots without any problems when using the BIOS installation option!


A "dual" (BIOS+UEFI) system that can boot both ways will have a freebsd-boot partition (used with CSM boot) and an efi partition, so it's easy to check. After the system has booted you can check with `sysctl machdep.bootmethod` how it did. It should tell you if it was UEFI or BIOS. 

Assuming you have a dual install, if it does boot with BIOS but not with UEFI you may need to fiddle around with efibootmgr(8) to tell the UEFI firmware there's something to boot from.


----------



## beast1e (Dec 2, 2020)

SirDice said:


> A "dual" (BIOS+UEFI) system that can boot both ways will have a freebsd-boot partition (used with CSM boot) and an efi partition, so it's easy to check. After the system has booted you can check with `sysctl machdep.bootmethod` how it did. It should tell you if it was UEFI or BIOS.
> 
> Assuming you have a dual install, if it does boot with BIOS but not with UEFI you may need to fiddle around with efibootmgr(8) to tell the UEFI firmware there's something to boot from.


I find out if the system is booting in BIOS or UEFI mode by taking a look at the first boot lines, if it's UEFI it starts with ''EFI Console" and if it's Legacy, then it's BTX Loader. But I might try that in the future, thank you!


----------

