Other What the purpose is of the GPT boot partition on Legacy BIOS

but I'm not sure what the purpose is of the freebsd-boot partition.
I have this question too. Why do you need a /boot partition for GPT.

For a UEFI-GPT install I understand the bootloader goes in /boot/EFI

But on a GPT-BIOS install why do you need the /boot partition?
 
To ensure that you can always boot from the used filesystem(s) no matter what filesystem your kernel is on. The separate boot partition is essentially a "filesystem independent" storage for your bootcode. And it's that boot code which enables the bootloader to access filesystems such as UFS and ZFS in order to load the kernel.
 
The freebsd-boot partition has nothing to do with the files in /boot, freebsd-boot doesn't even have a filesystem. The data from the freebsd-boot partition is loaded directly into memory and passed control to it. The code within freebsd-boot is either gptboot(8) or gptzfsboot(8). These in turn look for UFS or ZFS partitions, these are loaded and control is passed to loader(8), loader(8) eventually loads the kernel and starts it.

For a UEFI-GPT install I understand the bootloader goes in /boot/EFI
Actually no. The bootloader is loaded from a specific efi partition (which is really a FAT filesystem), this partition just happens to get mounted on /boot/EFI once the system is started.

But on a GPT-BIOS install why do you need the /boot partition?
There's really only one reason why /boot would be on a separate partition at all. And that's when you're using full disk encryption. Since you can't boot an encrypted partition the 'trick' uses an unencrypted partition containing /boot in order for the kernel to be loaded (through loader(8)). The loader(8) is smart enough to ask for keys and such and is capable of loading encrypted partition(s).


Short form:
BIOS (for both MBR and GPT) has no concept of filesystems. It cannot load UFS, ZFS or any other filesystem because it simply doesn't know how to. For MBR the first sector from the disk is loaded and passed control to it. This was, for a long time, the only way a system could boot. GPT is a little bit more involved, instead of loading the first sector of a disk it is capable of looking for specific 'markers', like the one used with freebsd-boot. Once the partition is found the whole partition is read 1:1 into memory and control is passed to it.

UEFI is a bit smarter, it's capable of reading a simple FAT filesystem. It looks for the specific efi partition and is capable of loading files from it.
 
Thank You SirDice for the in-depth coverage.
I always wondered why I couldn't mount freebsd-boot. You answered that question too.
 
If my intention is to use Grub as a boot manager on GPT can I dispense with the freebsd-boot partition?

I know I need to have a bios-boot partition.
 
Back
Top