Convert MBR Boot Drive to GPT without data loss

Posted on 20th Nov 2015 14:55:26 in SSD, NVMe

Creating the GPT Partition 

To create the GPT partition scheme for this project i used a Windows 10 USB install to create the standard Windows 10 GPT partition layout for booting in UEFI mode. The windows 10 installer created the default UEFI/GPT drive partitions and installed the necessary boot files and configuration to the System partition.

 

 

Cloning the Windows 7 Partition

Before cloning the windows 7 partition, make sure you have installed the samsung NVMe driver otherwise you will have problems after rebooting the cloned installation.

Next step was to reboot into Gparted Live and clone the Windows 7 partition over the Windows 10 partition.

Gparted

Repairing the System Boot Files

To repair the BCD boot configuration data for Windows 7 I simply booted from the Windows 10 USB install media and entered recovery mode, Advanced to get to a command prompt. From the command prompt investigate what the BCD configuration looks like after the clone.

Boot Configuration Data 

To view the BCD data from the command prompt: bcdedit /enum

Windows Boot Loader
-------------------
identifier {default}
device unknown
path \Windows\system32\winload.efi
description Windows 10
locale en-US
inherit {bootloadersettings}
recoverysequence {1b8b4660-8f49-11e5-9182-f70eafe59bdf}
recoveryenabled Yes
isolatedcontext Yes
allowedinmemorysettings 0x15000075
osdevice unknown
systemroot \Windows
resumeobject {1b8b465e-8f49-11e5-9182-f70eafe59bdf}
nx OptIn
bootmenupolicy Standard 

Comparing the Windows Boot Loader to the required windows 7 configuration there were several issues that needed fixing up. Device, OSDevice and description plus several settings that do not relate to windows 7, isolatedcontext, allowedinmemorysettings and bootmenupolicy.

Fixing the BCD data

After identifying the problematic entries are easy enough to update and the additional windows 10 related entries are removed.

bcdedit /set {default} device partition=c:
bcdedit /set {default} osdevice partition=c:
bcdedit /set {default} description "Windows 7 Ultimate"
bcdedit /deletevalue {default} isolatedcontext
bcdedit /deletevalue {default} allowedinmemorysettings
bcdedit /deletevalue {default} bootmenupolicy

The resulting fixed BCD data

Windows Boot Manager
--------------------
identifier {bootmgr}
device partition=\Device\HarddiskVolume2
path \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
description Windows Boot Manager
locale en-US
inherit {globalsettings}
default {default}
resumeobject {1b8b465e-8f49-11e5-9182-f70eafe59bdf}
displayorder {default}
toolsdisplayorder {memdiag}
timeout 30
Windows Boot Loader
-------------------
identifier {default}
device partition=C:
path \Windows\system32\winload.efi
description Windows 7 Ultimate
locale en-US
inherit {bootloadersettings}
recoverysequence {1b8b4660-8f49-11e5-9182-f70eafe59bdf}
recoveryenabled Yes
osdevice partition=C:
systemroot \Windows
resumeobject {1b8b465e-8f49-11e5-9182-f70eafe59bdf}
nx OptIn

Reboot and enter UEFI and disable CSM mode If you want to take advantage of the speed of pure UEFI booting.  Reboot and if all goes well you should now be booting into Windows 7 in UEFI/GPT mode.

Issues i had were when i connected disks with MBR partitions schemes, this would cause Windows to fail to load correctly. It appears the Windows 7 UEFI support is a little buggy if you connect disks partitions in the old style. To get around this i converted all the data disks to GPT format also , This did not appear to fix the issue. My goal was to update to Windows 10 so kicked off the upgrade and afterwards their ware no issues booting in pure UEFI mode. I have put this down to Windows 7's lack of maturity when it comes to UEFI mode.

Possible issues that may be related to the above behaviour.

http://superuser.com/questions/461979/windows-using-uefi-boot-on-gpt-disk-will-no-longer-boot-after-adding-an-mbr-ha