UFS UEFI booting with separate /boot partition

I am in the process of migrating to UEFI on my laptop. I would like /boot to be on a separate partition in order to have / on GELI, but I cannot get the UEFI bootloader to play along.
It finds both my mirrored /boot UFS partitions just fine, but refuses to continue because /boot/loader.efi does not exist.

I tried renaming the existing /boot/boot file (a piece of MBR bootcode, I presume) and creating a boot folder instead, containing a hard link to loader.efi. After rebooting I was dropped into a bootloader prompt, and using boot /kernel/kernel it actually booted the kernel.
However, the hardlinking trick did not work for loader.conf, so none of the required geom_ modules got loaded.

Is there a way to instruct the bootloader to look in / instead of /boot/, without modifying the source code?
I can't seem to find information about this matter in uefi(8) or any other part of the EFI-related documentation.
 
Have a look at Thread 51393. It is written for ZFS on GELI but can be adapted for using UFS on GELI.
Is there a way to instruct the bootloader to look in / instead of /boot/, without modifying the source code?
Not that I am aware of; what you want was not configurable for FreeBSD 10.1 and I don't see any indication of a change in the release notes for FreeBSD 10.2. However, given your question I can have a guess at where your issue is. I suspect that you have put the boot files at the root of an unencrypted UFS partition that you have configured to mount at /boot in /etc/fstab. Instead you need to create a directory called boot on that partition to contain your boot files. The way to think about it is that from the perspective of the boot loader, your unencrypted UFS partition is a minimal root partition and therefore needs to be structured in the same way as a full root partition on a normal system.

Unfortunately, this also means you need to do some fudging to make /boot appear at the correct place from the perspective of your running system for kernel updates and other system administration. The way to do it is to configure /etc/fstab to mount the unencrypted UFS partition containing your boot files at something like /ufsboot and then create /boot as a symbolic link to /ufsboot/boot (so that cd /boot actually puts you in /ufsboot/boot).

If this doesn't solve your issue or it isn't clear what I'm suggesting you do, please post the output of gpart show and the contents of /etc/fstab and /boot/loader.conf and I'll try to offer more specific help.
 
Have a look at Thread 51393. It is written for ZFS on GELI but can be adapted for using UFS on GELI.

Not that I am aware of; what you want was not configurable for FreeBSD 10.1 and I don't see any indication of a change in the release notes for FreeBSD 10.2. However, given your question I can have a guess at where your issue is. I suspect that you have put the boot files at the root of an unencrypted UFS partition that you have configured to mount at /boot in /etc/fstab. Instead you need to create a directory called boot on that partition to contain your boot files. The way to think about it is that from the perspective of the boot loader, your unencrypted UFS partition is a minimal root partition and therefore needs to be structured in the same way as a full root partition on a normal system.

Unfortunately, this also means you need to do some fudging to make /boot appear at the correct place from the perspective of your running system for kernel updates and other system administration. The way to do it is to configure /etc/fstab to mount the unencrypted UFS partition containing your boot files at something like /ufsboot and then create /boot as a symbolic link to /ufsboot/boot (so that cd /boot actually puts you in /ufsboot/boot).

If this doesn't solve your issue or it isn't clear what I'm suggesting you do, please post the output of gpart show and the contents of /etc/fstab and /boot/loader.conf and I'll try to offer more specific help.
Thanks a lot! I did not consider this solution at all.
 
Back
Top