If you want to boot FreeBSD UEFI mode, an
EFI System Partition is supposed to exist. I would have created one anew, even if just to make things easier, during
bsdinstall
: choose "manual" partitioning when asked, create a new partition, replace whatever is written as default (usually "freebsd-ufs") type with "efi", size it 512MB and set its mount point to, say,
/boot/efi. After install, run a shell instead of immediately rebooting and see for yourself that
/boot/efi is there, with
loader.efi somewhere inside (e.g. I have
/boot/efi/efi/freebsd/loader.efi here). Then reboot.
GRUB2 numbers your disks from 0 and partitions from 1. You'll need to find out these for FreeBSD root (the one you set to mount on "/" back in
bsdinstall
). (trial and error works fine here, just Google a bit to find out how to drop in a GRUB Shell intentionally, then try
ls (hd0,gpt1)/
increasing the numbers until getting your answer).
Avoid relying on
os-prober
. Edit
/etc/grub/40_custom as follows:
Code:
menuentry "FreeBSD" {
insmod part_gpt
insmod fat
insmod ufs2
set root=(hdX,gptY)
chainloader +1
boot
}
Replacing X and Y with the numbers figured out in previous step.
GRUB will have the right disk and partition set as root then chainload whatever is on it. If you did everything right, FreeBSD is there and will proceed with its own bootloader, there you'll have it.
Even if "+1" fails to do the trick, you must have had
boot listed by
ls (hdX,gptY)/
while in GRUB Rescue. Just
chainloader /boot/efi/efi/freebsd/loader.efi
and delete the last line ("boot") in
/etc/grub/40_custom. BTW,
# grubmkconfig -o /boot/grub/grub.cfg
after every time you edit this file. Ignore
$ update-grub
for a while, though (i.e. until you have your dual-boot working).
If you didn't create the ESP and relied on the one which was already there, you'll have to check if
bsdinstall
behaved as I think you expected (to have put a subdirectory "freebsd" and the
loader.efi there inside). That being the case, just find the partition
and disk number related, set as root, and chainload the whole path to loader.efi
e.g. let's say you had a
/boot/efi as ESP for xubuntu: just reapply the above logic for it (get
disk and partition number, edit
/etc/grub/40_custom with
set root=(hdX,gptY)
, then
chainloader /boot/efi/path/to/freebsd/loader.efi
).