[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Will this in-place conversion from LEGACY/MBR RAID1 boot to GPT/EFI boot work



On Mon, Oct 06, 2025 at 08:13:48PM -0500, Ram Ramesh wrote:
1. Find the BIOS boot disk and do not touch it (let us assume this is
  the the first SSD)
2. Fail and remove the second SSD in RAID1 and convert to GPT
   1. Delete all existing partitions
   2. Add EFI and BIOS boot partitions and the RAID1 partition of
      identical size. Keep the unused blocks in a partition as before.
3. Add back the new GPT partition to RAID1 and wait for sync
4. Once RAID1 is ready, convert boot to EFI boot on the second drive
  and reboot to check.
5. Once EFI boot is working, remove/fail  *first* BIOS boot SSD from
  RAID1 and convert to GPT and add back.

I think this is slower and more error prone than just building the new drive and copying. Boot from install medium into rescue mode, or use a live cd, then fail one of the drives and partition it, create as degraded raid1, and make filesystems. Then rsync the original / to the new one. Remember to update fstab on the new disk to new UUIDs or names. When you're happy you can repartition the other drive and add to the new raid1. The advantage here is that you've got two independent system disks and the ability to go back and forth without potentially having no working system.

On Tue, Oct 07, 2025 at 05:46:16PM -0500, Ram Ramesh wrote:
However, is it better to rsync the two EFI partitions or simply mount the second efi and grub-install creating a fresh copy of EFI files?

There's actually a wiki page on this, but the wiki is down. :( You can read it when it comes back, but the IMO the best solution is to add an executable file like /etc/grub.d/90_copy_to_boot_efi2 with contents like:

#!/bin/sh

if mountpoint --quiet --nofollow /boot/efi && mountpoint --quiet --nofollow /boot/efi2; then
    rsync --times --recursive --delete /boot/efi/ /boot/efi2/
fi

exit 0

(Assuming that your efi copies are mounted as /boot/efi and /boot/efi2.)
This automates the rsync so it's done whenever grub does an update, rather than manually installing to both (and potentially forgetting to update). If /boot/efi fails, you'll need to manually sync the new one. You'll also want to remember to add nofail mount option to both efi partitions in fstab.


Reply to: