Dual Boot + MBR->GPT updates

Hi!

I’ll try to sum up the story and give some background:

  • Old Windows system, upgraded 7->8->10, migrated from HDD to NVMe 2-3 years ago.
  • At some point a few years ago dual-boot with Fedora (main system now for work, Windows for gaming/music), now on F33.
  • BIOS is UEFI, with MBR partitioning for my two NVMe disks (yes, I know, that’s what happens when upgrading in place).
  • Windows installation is old but standard, only one drive. Fedora is using LVM (see partitioning below).
  • I want to use holiday break to update to F34 and Windows.
  • Last Windows 10 upgrade 2021H2 is stuck because of MSR partition than cannot be updated (normaly a size problem, but even with making some room does not solve it), and some complaining about partitioning not supported by EFI.

So what I’d like to do is to clean up things a little bit before/while updating both systems.
Part of this would be to convert MBR to GPT, which will allow getting rid of the MSR partition (and problem) in Windows.
Where I still have doubts is how to proceed best with the dual boot. I have read relevant material for both Fedora and Windows, but I did not find anything meaningful for this situation.

Any advice? Where to do the conversion from, order,…

Here is my main drive:


(First NTFS is MSR, then Windows)

Second drive is only one partition, part of LVM.

For me the partition order is not matter since the uefi firmware smart enough to detect where the EFI partition is.

But if you ask about the order on how to migrate (please read all and cross check first or maybe you could wait if there other user here will give some advice):

First you could start with upgrade your installed Fedora Linux with latest packages dnf upgrade, reboot. Then start upgrading to Fedora Linux 34. Make sure this newly upgrade are working fine.

Using Windows, convert the drive from mbr to gpt. Looks like Windows already have the tool for that (source), and it’s good news.

After successfully converting the drive to gpt with Windows, check with Fedora Linux liveUSB to find the new partition layout. There should be a partition with directory like /EFI/Microsoft. Create new empty folder /EFI/fedora

Then chroot your Fedora Linux instalation.

The most important thing, don’t forget to mount newly folder we created above /EFI/fedora to /boot/efi. So the complete path when we inside chroot, should be /boot/efi/EFI/fedora.

After successfully chroot installed Fedora Linux, backup your grub.cfg sudo mv /boot/grub2/grub.cfg /boot/grub2/grub.cfg.backup.

Then reinstall/install the some packages sudo dnf reinstall shim-* grub2-efi-* grub2-common.

Exit the chroot.

To make sure that installed Fedora Linux already in efi, check with (without chroot):

$ sudo efibootmgr -v
Boot00XX* Fedora	HD(1,GPT,<somegptnumber>)/File(\EFI\fedora\shimx64.efi)
Boot00XX* Windows Boot Manager	HD(1,GPT,<somegptnumber>)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS......

If from efibootmgr -v installed Fedora not pointing to /File(\EFI\fedora\shimx64.efi), you could fix it with:

# Below example using /dev/sda drive, change it accordingly and 
# no need the partition number layout, just /dev/sda.
$ sudo efibootmgr -c -d /dev/sda -L Fedora -l \\EFI\\fedora\\shimx64.efi

To change between the OS, it could be done by changing the boot order from the UEFI BIOS.

Thanks a lot, exactly the kind of process I was looking for. That makes total sense. I’ll try it tomorrow only though, as it’s now my first rodeo and I learned that it’s not the kind of things you start at night! Will post results here. Thanks again!

Hello,

My suggestion is less typing:

First backup all user data to external media.
As appropriate download and build bootable usb media from Microsoft.com, getfedora.org Use microsoft media creator software for microsoft bootable, and fedora media creator for fedora.
Explicitly overwrite mbr with zeroes. I use linux dd command for this.
Use favorite disk partitioner and delete ALL partitions, leave disk as unpartitioned unformatted free space.
Enter BIOS setup, set to factory defaults, including UEFI booting and Secure boot activated.
Install Windows.
Use Windows disk management software to shrink windows to create room for fedora. (I like 500GB for fedora.)
Install fedora. (Just select “Install” on anaconda and accept the automatic disk configuration.)
Enjoy!

@showmestate Thanks, but no thanks. This is what I wanted to avoid, spending hours to reinstall/reconfigure everything properly. Unfortunately I don’t have just a browser, a text and a spreasheet editors plus a few files on those systems.

@oprizal Thanks a lot, it worked almost like a charm. So I’ll leave a few notes here for people interested:

  • Windows 10 mbr2gpt never wanted to do its job. The tool failed at partition verification. I reverted to using AOMEI Partition Assistant. I had to buy the Pro version, but it was worth it, the MBR to GPT conversion took 30 seconds on each disk. As part of the process, the tool found the already existing EFI partition and “updated it” (instead of creating a new one, which would happen when there is none I guess). Basically it seems it wiped it out and installed Windows stuff.
  • chrooting from the LiveCD went well. At first I had some fears because root and home were on LVM on two different drives, but no! This lets you see and activate the volumes properly:
vgscan
vgchange -a y
lvscan

Then you can mount all the needed partitions inside the Live environment, and chroot properly.

  • First reboot in Fedora was problematic. One volume mount hanged, so Fedora booted in emergency mode. But… I had no password set for root, so it was impossible to log into the console! Back to Live, chroot, passwd root, and reboot!
  • The issue was that the EFI partition had changed UUID, surely because the tool I used recreated it from scratch. But the old UUID was still in /etc/fstab. I just corrected it for the new one, and everything went fine!
    Fedora is now at 35, both disks are GPT, and Windows is updating properly. I only need to do some cleanup in Grub which has the old Windows references. Not an issue for now though as I can choose the OS from UEFI boot.
    Thanks again!

Hi, I want to recheck first with other machines I have before ask for confirmation, but unfortunately all remaining machines here did not support UEFI.

Did you specified the disk number when running disk verification like MBR2GPT /validate /disk:<disk-number> or just applied it with MBR2GPT /validate?

And also, usually I leave some spaces manually and leave it blank during conversion.

Btw, we could convert it manually using gdisk if there no Windows OS. All we need are to create two new partitions: bios boot [ef02] (usually I make 5Mb) and EFI system [ef00] (ussually I make at least 200Mb). Then reload the partition with partprobe /dev/sda.

iirc I checked without specifying the disk. But according to doc in this case it checks against current system disk.
There also was a 1GB empty space after windows partition, so room enough if needs be.
But still the MS tool would not validate.
Anyway, using the AIMOE Partition Manager it worked flawlessly, recognized everything, reused the existing EFI partition, and converted both disks in a few seconds.