It's a bit difficult to find an easy to understand explanation of what /boot/
and /boot/efi/
actually are.
I've found some possible answers through testing and googling but would be very happy if someone with experience could challenge or confirm my findings / way of thinking.
Context:
- Compatibility Support Module (CSM) in the motherboard is turned OFF
- Fast Boot and Secure Boot in the motherboard are both turned OFF
- Operating System is Ubuntu Server 22.04
- Setup uses two disks with identical capacity (for RAID 1)
- Both disks are in GPT format and on both disks the EFI-System Partition is partition number
1
with size512MB
(and type1
of course). /
is a software RAID 1 created withmdadm
.- More broadly: I'm doing some testing to better understand how software RAID works and how I can deal with possible RAID "errors" (e.g. swapping a faulty disk, booting from only one of the disks etc.) in the future.
My findings (based on the context above) / Questions
1.) Observation: /boot
is not the EFI-System Partition. I.e. it does not contain the bootloader.
However, it contains the GRUB configuration files (/boot/grub/
in my case).
I tested this by installing the bootloader (with the ubuntu server installer) on both disks, then made a change to the grub configuration file (/etc/default/grub
, added intel_iommu=on
as a "dummy" flag then ran update-grub
), shut down the server and physically removed the drive whose EFI partition was mounted when I did the change). Server booted but got stuck in ''emergency'' mode because the OS couldn't find the drive with the EFI-Partition that was specified in /etc/fstab
(the ubuntu server installer added the mount point with the UUID of the drive I removed).
However cat /proc/cmdline
did show that intel_iommu=on
was specified.
This leads me to believe that the grub configuration isn't stored on the EFI-Partition and is part of the software RAID I created when I installed the system.
2.) Observation: /boot/efi
is a mount point of the EFI-System Partition which in turn gives access to the installed bootloader.
At least one of the drives needs to have a bootloader installed (on the EFI-System Partition that is mounted here), otherwise the system will not boot.
Bootloader (GRUB) can be re-installed by running grub-install /dev/sd{x}
.
3.) [If 1. and 2. are indeed true], question: Is it necessary for the Ubuntu OS to mount the EFI-System Partition in order to function?
Could I omit the mount instruction inside of /etc/fstab
?
This is just a question out of curiosity.
sudo grub-install
in my UEFI system (not RAID) and it installs to y main & correct ESP. I have reset ESP in fstab to be my sdb drive & it reinstalls the that ESP. UEFI uses GUID/partUUID to know ESP, ESP has 3 line grub.cfg to boot grub.cfg in /boot. askubuntu.com/questions/792413/… seelsblk -e 7 -o name,fstype,size,fsused,label,partlabel,mountpoint,uuid,partuuid
&sudo efibootmgr -v