Yes for /boot/efi but....
That is what I'm talking about, because the EFI system partition can not be in raid and must be a fat32 partition.
So you need to have that on both disks to be able to boot, right?
If this one is only on disk 1 (like /dev/nvme0n1 for example) and this drive goes broke, then you should have it on /dev/nvme1n1 (second device) too already, otherwise no boot. Right?
So that part is what I'm wondering about.
With MBR this was much easier, just give the grub copy command and you're done. I haven't done this with EFI and GPT yet, which makes me curious too.
You would format the resulting
/dev/mdxxx device as vfat and put the EFI files in there. As long as
/dev/mdxxx is a RAID1 which is a 1:1 mirror, it doesn't matter which disk the BIOS boots from, they're identical anyway (unless the RAID is degraded... but this changed so infrequently it doesn't really matter... and if you keep the last 2 or 3 kernels installed then at worst, you'll boot into an older kernel and will have to rectify the issue later).
But the
/dev/mdxxx device has to be using mdadm meta version 1.0 in order for the partition to be recognized by the BIOS when it offloads to EFI.
If the device is RAID10 then half the bits are on one physical drive and half are on another physical drive - that won't work.
Alternatively, you can partition a small EFI (which is really just a special vfat partition) partition on each drive and mount each drive separately on the system (i.e.
/boot/efi,
/boot/efi2,
/boot/efi3...) and use rsync or some other system utility to insure that the extra
/boot/efiX directories keep a 1:1 copy of what's in
/boot/efi. There really shouldn't be any modifications to
/boot/efi unless there is a kernel upgrade.
When the BIOS offloads to EFI it doesn't really make a distinction between
/boot/efi,
/boot/efi2, or
/boot/efiX ... it just looks for an EFI partition.
You can actually use
efibootmgr to show the order of the EFI boot.
Then pay attention to the
BootOrder line.
Find the corresponding
BootXXXX in the list, it will say something like:
Code:
Boot0000* AlmaLinux HD(3,GPT,f678152c-d50e-4515-9bbc-e8265b54732d,0x139f000,0x7d800)/File(\EFI\almalinux\shimx64.efi)
Then find the correspond UUID, or usually it's the PARTUUID for the stated drive
Code:
blkid | grep "f678152c-d50e-4515-9bbc-e8265b54732d"
This will tell you what drive and partition this referring to, i.e.
/dev/nvme0n1p1
Then you'll find that
/dev/nvme0n1p1 is a member of the mdadm RAID1 device that's mounted on
/boot/efi and the mdadm RAID system is keeping that mirrored. This is essentially the same thing as using an OS level tool like rsync to keep
/boot/efi2 as a mirrored copy of
/boot/efi
In a lot of ways, EFI is actually better than MBR booting because you can actually control this from the underlying OS. You can use the same
efibootmgr command to change the boot order if you want.