[Durham] UEFI and grub2 booting

Martin Ward martin at gkc.org.uk
Thu Mar 12 19:10:35 UTC 2020


Here's the solution I found in the end:

(1) I could edit /boot/grub2/grub.cfg to add new entries for
the various root partitions on different disks. I have /root1
and /root2 on one drive and /root3 and /root4 on another.
This is fine for booting to another root eg if an update
causes something to fail. But if the drive with the EFI partition
on it fails, or the drive with /root1 on it fails, then booting
will fail (/boot/grub2/grub.cfg is on /root1)

(2) I created an EFI partition on a separate drive: this is a 210MB
FAT32 partition which is the first partition on the disk with
flags "boot" and "esp" set. This is mounted on /root2/boot/EFI

(2) I booted into /root3 and then ran:

grub2-install --target=x86_64-efi --efi-directory=/root2/boot/EFI 
--bootloader-id=mageia2

This creates an EFI boot entry on the new EFI partition which will read
/boot/grub2/grub.cfg from the current root (which is /root3).

By pressing F8 on boot I can select the mageia2 EFI entry,
(which is on a different disk to the default EFI partition).
This reads from /boot/grub2/grub.cfg on /root3 and can then
boot into /root3 (which is on a different disk to the default root).

-- 
			Martin

Dr Martin Ward | Email: martin at gkc.org.uk | http://www.gkc.org.uk
G.K.Chesterton site: http://www.gkc.org.uk/gkc | Erdos number: 4



More information about the Durham mailing list