MBR to GPT conversion (Dual Boot, OS's on different SSD's)

Okay, I’ll make this a quick why I’m on still CMR instead of UEFI boot process and MBR - my Windows & Linux installs go waaaaaaay back when this machine was a Phenom II X6 system (it’s a 3600X now)… Actually the Kubuntu install is even older still (it started off on a AMD Opteron 170 as an install 6.06 Dapper Drake)…

Yes, I’m pretty good about my maintenance keeping Windows very clean (it has broken a few times over the years, but I’ve been able to fully fix it every time with out re-installs).

The two reasons I want to do this conversion - first is so I can enable AMD’s “SAM”. You can’t do that booting CSM or off MBR (weird, but okay)… The 2nd, so I’ll be able to upgrade to Windows 11 at some point while satifying the requirement for TPM being enabled.

Anyways, I don’t care if it takes longer to do - I just don’t feel up to reinstalling OS’s (and frankly, I like saying my install is ancient history - LOL). I have my system fully backed up, and want to check on how to do this the proper way - I’m not finding much good info on how to do this when one has two OS’s and multiple disks… Lot’s of info for Win10 users, less info for Linux users, and no info at all when one OS is on one drive and the other OS is on a different drive involved… So hoping someone has experience and say yes or no on if I got this conversion process right (and that this will be documented for anyone else needing to do this).

Phase one (have bootable USB keys)

  1. Make Windows 10 recovery disk (in case something goes wrong).
  2. Make Linux (Kubuntu in my case) install/recovery disk.

Phase 2 (Winblows conversion)

  1. Reboot Windows 10 in trouble shooting mode.
  2. Goto to command prompt, check to ensure drive can be converted:
    mbr2gpt /validate
  3. Fix any show stopping problems if needed (because Windows)…
  4. Run the conversion process:
    mbr2gpt /convert
  5. Reboot into Windows 10 (there won’t be any grub at this point).
  6. Using diskpart, ensure that disk conversion has taken place (because Windows).
  7. Reboot but before system boots go into UEFI/BIOS and disable legacy CSM boot mode. If not already done (it is on my system), enable TPM (and make any other adjustments so that one can enable resizeable bar support if wished - again, already done on my system)
  8. Boot into Windows, use msinfo32 to check and ensure that Windows is operating in UEFI secure boot mode. Find and fix any problems if it isn’t (again, because Windows).

Phase 3 (Linux Conversion)

  1. Boot Linux install/recovery disk to a recovery terminal.

Note: this is where I’m not clear - there is an EFI directory on the first drive (sda), and all directions I have involve creating an EFI directory on the same drive - so I’m going with my gut on what needs to be done)

  1. Use gdisk to convert the 2nd drive (sdb) from mbr to gpt (sda is already complete):
    sudo gdisk /sdb
    w

  2. Bind the installed linux to the runnig recovery linux running and change root:
    sudo mount /dev/sdb1 /mnt
    sudo mount /dev/sda1 1 /mnt/boot/efi
    ; Note: This will be the efi directory I believe - need to confirm which directory is the EFI directory on sda
    sudo mount -o bind /dev /mnt/dev
    sudo mount -o bind /sys /mnt/sys
    sudo mount -t proc /proc /mnt/proc
    sudo cp /proc/mounts /mnt/etc/mtab
    sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
    sudo chroot /mnt

  3. Change grub from the old mbr style and add it to the efi boot:
    sudo apt-get --reinstall install grub-common grub-efi-amd64 os-prober

  4. Opps, need everything signed for the secure boot process:
    sudo apt-get install shim-signed grub-efi-amd64-signed linux-signed-generic

  5. Install grub to EFI:
    sudo grub-install --uefi-secure-boot /dev/sda
    sudo update-grub

Reboot and everything “should work”

Does this all sound correct, did I miss or overlook anything? I just want to ensure my sanity is correct so I only have to do this the one time (and anyone else needing to know this has it documented). :wink:

1 Like

Looks about right. I have not messed with the signed stuff though so I don’t know if that part is as straight forward as you have it.

If you want to be extra careful, you can make an EFI boot partition on SDB as well. I dual boot between Debian SID and ArchLinux. I use grub on the Debian partition and efiboot on the ArchLinux partition.

Benefit: If one of the drives get hosed, I can still boot into the other system. Using the boot loader of each device, I can still try to boot into the other OS. I have had to do this before where a poorly executed system update bricked the OS and I used the initrd and kernel of the other OS to boot into the bricked one to chroot and fix the installation.

In the past MS Windows used to actively nuke anything GNU/Linux and BSD related on major updates. I only trust MS Windows to exist on it’s own drive.

1 Like

I made backups to regular HDD’s (cloned the Windows SSD, just a regular old copy of the Linux drive - it’s been on countless machines - way easier to copy it over to a new drive or machine then to start from scratch).

I haven’t done this type of conversion before - that’s why I was double checking (it’s the mounting of the efi I’m slightly worried about - I really wasn’t sure if that was correct because I’ve seen “mount /dev/sdb1/boot/efi /mnt/boot/efi” which really didn’t look correct to me).

Okay, since it looks about right, I’m going to see about making it happen this weekend. I’ll edit in any updates and or fixes to the directions. Big thanks, and cheers! :slight_smile:

2 Likes