Your statement is perfectly correct, but the issue here I am trying to communicate is that GRUB doesn't boot from Debian or any other OS.In a typical Debian install, /dev/sda1 is created and fat(fat32) partitioned by Debian. Debian creates and hosts the /etc/fstab entry and the supporting configuration files in /etc/grub.d/. I've never tried it, but potentially, one could create a mount point in OpenBSD/FreeBSD and mount the slice containing /boot/efi.
Conceptually, there is a misunderstanding about "root" It is not the location of the FreeBSD installation but the location of OS, in this case Debian, that contains Grub. This is the first stage of the boot process where a boot menu is presented and you are booting Debian. [...] Debian passes the second stage of the boot process to FreeBSD.
The GRUB boot loader (on BIOS or UEFI) is loaded independently of Debian or other operating systems, in fact, no operating system is needed to be booted for GRUB loader to be loaded.
Debian (or any other Linux distribution, or Operating system) has no participation in booting the GRUB loader.
The GRUB loader is stored on BIOS MBR between MBR and first partition.
On BIOS GPT and UEFI GRUB embeds its core images on a unformated "bios-grub" flagged partition. It can be a standalone installation without any OS at all.
Usually the operating system next to the GRUB loader provides within its directory structure stored configuration files, fonts, background images at most. But those can be stored in a non-OS file system, a fat32 formatted EFI partiton, or any other file system GRUB is capable to read from.
Below you will find instructions for reproducing a GRUB installation on a dedicated partition, no Linux (or other OS) installed beside:
BIOS MBR: https://forums.freebsd.org/threads/mount-error.89083/#post-610435
For BIOS GPT create a "bios-grub" partition as described below, continue GRUB installation as instructed in the above link.
UEFI: Assuming sda as the "GRUB on dedicated partition" disk.
- Boot Linux Live system (or installation). Partition sda,
- create 1MB partition (or minimum permited by a partition manager) unformated
- set bios-grub flag for 1MB partition
- rest of the disk format fat32
- mount fat32 partiton on /mnt
- execute
Code:
sudo grub-install --root-directory=/mnt /dev/sda --verbose
sudo cp /boot/grub/grub.cfg /mnt/boot/grub
umount /mnt
The grub-install command creates a EFI boot entry, when sda disk is moved to another machine, the GRUB efi loaders path does not match most likely.
On target machine, boot a Live system (Linux, or FreeBSD), delete the EFI menue entry, create a new one for GRUB, ie from Linux live:
Code:
mount -t vfat /dev/sda2 /mnt
efibootmgr -c -L GRUB -l /mnt/EFI/<linux distribution name>/grubx64.efi
efibootmgr -a -b <menue entry number>
Power down machine, remove Live system, power up machine.
Some background image and font might not be found because they are not on the EFI partition, just hit enter until the GRUB menu appears.