The standard place (at least for Debian) for your EFI partition is
/boot/efi. This can be and should be a FAT32 partition.
In a standard Debian Grub EFI layout, grub has three parts:
Mounted EFI partition
Contains stub grub bootloader and config
Same partition /boot or /
Contains grub modules and actual grub configuration
Same partition as /
Contains automatic configuration scripts
Grub does not install itself entirely on EFI, a significant proportion of it lives elsewhere. So to be able to boot you do still need
/boot/grub. It only installs a stub and stub config to point itself to the rest. A typical EFI stub configuration looks like this (
search.fs_uuid 2c675303-d207-4573-98f5-59a33c9890ab root hd0,gpt3
Notice how this config only tells grub where to find the real config (
/boot/grub/grub.cfg located on hard disk 0 partition 3).
Also note that even though the configuration is primarily stored in /boot/grub, you never edit this manually, you ask grub script to edit it for you. And so to reconfigure grub (even just to add a new kernel) you also need
/etc/grub.d. Note that scripts in this directory may be reliant on other libraries installed by Debian.
Therefore you must keep /boot/grub for two reasons:
- It contains your actual config and grub modules.
- So that the the automatic configuration scripts know where to write new config.
If you really want move
/boot/grub onto EFI... (non-standard)
There's nothing actually stopping you. Just make sure that the scripts in
/etc/grub.d know where to find it (eg: leave a symbolic link)
I've done this before for esoteric reasons. I run a system with an EFI partition containing two directories
grub. I set this up with:
# Move /boot/grub onto my EFI partition
mv /boot/grub /boot/efi
# Leave a symbolic link from the old location to the new location
ln -s /boot/efi/grub /boot/grub
# Update the stub config /boot/efi/EFI/debian/grub.cfg to point to the new location
# For safety update the contents of /boot/efi/grub aka /boot/grub
I actually like this setup because it protects against the mistake I've seen several times here where people delete an OS and destroy grub and prevent any other OS from booting.
Reasons for partitioning
Partitioning has a number of purposes. With regards to partitioning parts of your boot loader, this is useful to handle different capabilities of various parts of your system.
- Your BIOS can only read FAT based file systems
- Grub has pretty good support for file systems but LVM and encrypted volumes can be a problem
- Linux can read everything
- Old Grub legacy could not read very large disks or partitions
Your BIOS needs to be able to load and run grub, so EFI needs to be on a FAT based file system.
Your master partition might be on something grub can't read, but grub needs access to your Kernel, Initramfs and it's own config, so /boot and /boot/grub need to be on a partition readable by grub. In the old days of grub legacy you also needed to ensure this partition was small enough and near the beginning of the drive on very small disks.
Linux can read everything, but you might want linux to run on an LVM or encrypted volume.
/boot/efidoes not need to be on the same partition as
/boot. In a typical properly set-up Debian system,
/bootwill be a Linux standard filesystem (ext, xfs, etc.), and
/boot/efiwill be a separate partition formatted following the UEFI standard (a FAT based filesystem IIRC). I do not see any benefits from putting things in different locations. People with a lot more experience have figured out how to make this work already; why mess with that?