# Issues installing on a UEFI / GPT system.



## marco_r (May 1, 2013)

I'm trying to install FreeBSD 9.1 on an Asus X501A laptop.

Since the USB installation medium doesn't boot with UEFI, I disabled SecureBoot, enabled the CSM and then I was able to boot from the USB key.

The laptop contained the following partitions:
EFI system partition (300M)
Basic data partition (600M)
Microsoft reserved partition (128M)
Basic data partition (186G) [Windows 8 C:]
Basic data partition (254G
[Windows 8 D:]
Basic data partition (20G) [Recovery Partition]
I'm not interested in keeping Windows 8 but just not to mess things up too much (and to keep the recovery partition), I simply deleted the "D:" partition and started the installer.

I dd'ed the recovery partition on another computer (I couldn't find a tool to create recovery disks from the partition... wft?) and more or less followed the guide at https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot for a ZFS only install (with some differences mostly due to different paths).

When I rebooted after the installation I wasn't able to boot any OS. The boot menu (pressing the Esc button) won't show any O.S., not even after disabling the CSM, and using F9 to boot the recovery partition won't work. (Previously, both Windows and the recovery tool would work either with CSM enabled or disabled).

Removing the BSD partitions and installing with bsdinstal doesn't help.

My only guess is that the command `gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 6 ada0` did something wrong (or the BIOS is somewhat broken and doesn't like what gpart did).

Any idea on what I could try at this point?


----------



## kpa (May 2, 2013)

FreeBSD does not yet have support for direct UEFI boot. Instead the legacy MBR method must be used with /boot/pmbr as the first stage boot loader. Some UEFI BIOSes are unfortunately broken and choke up on disks that are both UEFI compliant but also have a valid MBR bootcode and partition table. I would try to zero out the MBR totally, take a backup of it first though.


----------



## marco_r (May 3, 2013)

kpa said:
			
		

> FreeBSD does not yet have support for direct UEFI boot. Instead the legacy MBR method must be used with /boot/pmbr as the first stage boot loader. Some UEFI BIOSes are unfortunately broken and choke up on disks that are both UEFI compliant but also have a valid MBR bootcode and partition table. I would try to zero out the MBR totally, take a backup of it first though.



Thanks @kpa. In fact I was able to restore the original boot options this way.

Anyway does this mean that I won't be able to boot FreeBSD at all on this machine unless I use something like an USB key?


----------



## kpa (May 3, 2013)

I think so yes until FreeBSD gets a proper support for UEFI boot.


----------



## SirDice (May 3, 2013)

I've been mucking about with my system, which UEFI boots Windows 7 and boots FreeBSD (with ZFS).

Have a look at my old thread, there may be some pointers (especially regarding the 'fake' MBR scheme); Thread 35897


----------



## marco_r (May 4, 2013)

Alas, the trick about zeroing the active flag didn't work for me. Is it possible to install Grub (for example) and then boot FreeBSD from it?


----------



## zspider (May 5, 2013)

If support isn't already available in STABLE or CURRENT, it will be soon enough.

http://forums.freebsd.org/showthread.php?t=38206


----------

