FreeBSD 10.1-STABLE: UEFI booting from USB flash drive + FBSD system on HDD

Julien Meister julien.meister2 at
Thu Dec 25 14:32:21 UTC 2014

Hello everybody,

I've been trying to make UEFI booting work on my Thinkpad T420. My goal is
(as I had previously done with BIOS) to boot FreeBSD from a USB flash drive
with my laptop hard drive encrypted.

The T420 is able to boot using UEFI if the /boot partition is on the same
disk as the other partitions. So installing FreeBSD on a USB flash drive OR
on the HDD works fine with UEFI. (I haven't tested encryption yet)

However, when trying to boot from USB and then access the ROOT partition on
the HDD (which will be the case later when my HDD will be encrypted), I get
the following panic:

*>> FreeBSD EFI boot block*
*Loader path: /boot/loader.efi*
*File /boot/loader.efi not found*
*panic: Load failed*

=> USB flash drive contains: EFI partition + /boot
=> HDD contains the rest (which will be encrypted)

Here are the commands I used (without encryption for the moment):

*# gpart destroy -F ada0*
*# gpart destroy -F da0*

*# gpart create -s gpt ada0*
*# gpart create -s gpt da0*

Create the EFI and /boot partition on the USB flash drive:
*# gpart add -t efi -a 4K -l bootefi -s 800K da0*
*# gpart add -t freebsd-ufs -l usbboot -s 768M da0*

Prepare the EFI partition:
*# dd if=/boot/boot1.efifat of=/dev/gpt/bootefi*

Partition the HDD. For this example, I will only use one big / partition.
*# gpart add -t freebsd-ufs -a 4K -l gprootfs ada0*

Newfs and mount everything:
*# newfs /dev/gpt/usbboot*
*# newfs /dev/gpt/gprootfs*

*# mkdir /tmp/mnt*
*# mount /dev/gpt/gprootfs /tmp/mnt*
*# mkdir /tmp/mnt/boot*
*# mount /dev/gpt/usbboot /tmp/mnt/boot*

Install FreeBSD:
*# sh*
*# for file in kernel.txz base.txz lib32.txz; do *
*untar --unlink -xpvJf ${file} -C /tmp/mnt done*

chroot into the new system and create /etc/fstab and /boot/loader.conf

*#chroot /tmp/mnt*
=> Edit /boot/loader.conf
*#echo 'vfs.root.mountfrom="ufs:/dev/gpt/gprootfs"' > boot/loader.conf*

=> Edit /etc/fstab
*#echo '/dev/gpt/gprootfs / ufs rw 1 1' > etc/fstab*

Unmount everything and reboot
*#cd /*

=> Unmount usb flash drive
*#umount /tmp/mnt/boot *

=> Unmount hdd
*#umount /tmp/mnt*


And I get a panic (as shown above)
*>> FreeBSD EFI boot block*
*Loader path: /boot/loader.efi*
*File /boot/loader.efi not found*
*panic: Load failed*

Any idea on how to make this work with UEFI? From what I understood, EFI
tries to boot on the first ufs partition found. It should be therefore
[FILE]da0p2[/FILE] ... but it isn't.

Thank you very much

More information about the freebsd-questions mailing list