MBR2GPT: Converting MBR to GPT Disk in Windows 10

Mbr2gpt.exe is a new utility integrated into the Windows 10 console that allows you to convert a hard drive with MBR (Master Boot Record) partition table to GPT (GUID Partition Table) without losing data or deleting an existing partition. The mbr2gpt tool can be used to convert the partition table in Windows PE (Windows Preinstallation Environment) or directly from Windows 10. This tool allows you to change the partition table from MBR to GPT, both on the data disk (non-system disk) and on the system disk where Windows 10 is installed (using the /allowFullOS option).

How does the MBR2GPT tool work?

The mbr2gpt.exe tool is part of a Windows 10 image of version 1703 (creator update). You can use mbr2gpt to convert a disk from MBR to GPT offline on earlier versions of Windows 10 (1507, 1511, and 1607). Earlier versions of Windows (Win 7/8.1) are not officially supported.

Pay attention. Previously, you could use the third-party tool gptgen to convert a non-system disk from MBR to GPT without losing your existing partitions. However, in order to convert the system disk, it was necessary to completely clean the disk, create a GPT partition table and new partitions, and then perform a clean installation of Windows 10.

The MBR2GPT documentation states that the following conditions must be met to convert the partition table of a hard drive to GPT :

  • The current partition table of the hard drive is the MBR ;
  • The disk has free space to place the primary and secondary GPT tables at the beginning and end of the disk;
  • The MBR table should contain no more than 3 partitions, one of which should be active (there should be no additional logical partitions);
  • The BCD configuration must have a boot record pointing to the Windows partition.

The logic of Mbr2gpt when converting an MBR disk to GPT is as follows:

  1. Disk Check ;
  2. If there is no EFI System Partition (ESP), it will be created using the free space of one of the partitions (if there is not enough free space, the error message Could not find space for an EFI System Partition will appear);
  3. The UEFI boot files are copied to the EFI partition;
  4. Metadata and GPT partition table are applied to the disk (MBR partition table is converted to GPT with no data loss on existing partitions);
  5. The BCD bootloader configuration has been updated.

Syntax of the MBR2GPT tool :

mbr2gpt /validate|convert [/disk:] [/logs:] [/map:=] [/allowFullOS].

  • /validate – the disk is only checked if the partition table can be converted (including checking the free space to store the primary and secondary GPT tables) : 16 KB + 2 sectors at the beginning of the disk and 16 KB + 1 sector at the end) ;
  • /convert- Start converting the hard drive if the check was successful;
  • /disk:- specifies the number of the disk to be converted to GPT. If the number is not set, the system disk is converted (like the Diskpart: select disk system command).
  • /logs:- specifies the path to the directory where MBR2GPT should write the log files. If the path is not specified, the %windir-% folder is used. Log files: diagerr.xml, diagwrn.xml, setuperr.log and setupact.log ;
  • /map:- allows you to specify additional partition table mappings between the MBR and GPT. Например, /map:42={af9b60a0-1431-4f62-bc68-3311714a69ad}. The MBR partition number is specified in decimal notation, while the GPT GUID contains delimiters. You can specify more than one card at a time;
  • /allowFullOS- By default, MBR2GPT can only be used in Windows PE. You can use the allowFullOS parameter to convert the system disk directly from a running Windows 10.  This key allows you to run the tool in a full Windows environment. If you do not specify this setting when using mbr2gpt on Windows, an error occurs: ERROR: The MBR2GPT can only be used from the Windows pre-installation environment. Use /allowFullOS to cancel.

Convert the hard disk from MBR to GPT without losing the gift of Windows 10.

The process of converting MBR disk to GPT disk is not reversible. Before converting, make sure your computer supports UEFI.

Before converting the partition table, check the current system disk for MBR to GPT conversion:

mbr2gpt.exe /disk:0 /verify /records:C:logs /allowFullOS

MBR2GPT disk validation : An attempt is being made to check the drive 0
MBR2GPT : Retrieve the layout of the
MBR2GPT hard drive: Validation facility, disk sector size : 512

Line MBR2GPT : A successful test indicates that the disk can be converted. Line MBR2GPT : Failure of the disk layout check means that the disk cannot be converted because it does not meet the conditions.

Another common error, can’t find OS partition(s) for disk 0, is usually related to using a third party boot loader or selecting the wrong disk for the conversion. You can also try moving the Windows boot files to the system partition (bcdboot c:Windows /f bios /s c:), and checking the correct entries for the WinRE environment on the BCD (reagentc /disable && reagentc /enable).
If the system drive is encrypted with BitLocker, you must decrypt it before converting.

You can now convert the partition table on the system disk:

mbr2gpt.exe /convert/disk:0

The MBR2GPT will now try to convert disk 0.
If the conversion is successful, the player can only be started in GPT mode.
These changes cannot be undone!
MBR2GPT : We’re trying to convert the drive 0
MBR2GPT: Retrieve the layout of the
MBR2GPT hard drive: Format, disk sector size enable: 512 bytes
MBR2GPT : I am trying to reduce the
MBR2GPT system partition: I am trying to shrink the
MBR2GPT partition of the operating system: Creating an EFI
MBR2GPT system partition: Installation of the new boot files
MBR2GPT : Rebuilding the layout
MBR2GPT: The default migration of boot records is
MBR2GPT : Added boot record
MBR2GPT: Correction of the correspondence with the drive letter
MBR2GPT : Conversion completed successfully
MBR2GPT : Before the new system can boot correctly, the firmware must be changed to UEFI boot mode!

Converting a drive from MBR to GPT from a Windows 10 installation happens in seconds.

To force the computer to boot from a new EFI partition, you need to change its settings to boot in UEFI mode. Reboot the computer and change the boot mode in the UEFI configuration from Legacy (BIOS) to UEFI (Pure) and save the changes.

Windows 10 should start successfully. With msinfo32.exe you can check whether Windows 10 is booted in BIOS mode = UEFI.

The main advantages of switching to native UEFI mode and the GPT partition table :

  • You can create a partition that is larger than 2 TB ;
  • Protect your boot environment with the Secure Boot ;
  • ELAM (Early Launch Antimalware) Technology ;
  • Device Guard and Credential Guard in Windows 10 Enterprise ;
  • Measured load

Convert MBR to GPT when installing Windows 10

The mbr2gpt tools can be used when installing Windows 10. You have z. B. has created a UEFI bootable flash drive and is trying to install Windows 10 on a hard drive with an MBR partition table on a UEFI-based computer. In this case, an error is displayed:

Windows cannot be installed on this drive. The selected drive has an MBR partition table. On an EFI system, Windows can only be installed on GPT disks.
drives.

If you don’t want to lose the existing data partitions on the MBR disk (it was used to boot in legacy mode or on a BIOS computer) when you change the disk partition table to GPT, you can convert the MBR disk to GPT directly from the Windows 10 configuration window.

  1. Press Shift+F10 on the Windows 10 setup screen to open the command line for the WinPE environment;
  2. Check if you can change the partition table of the disk to GPT. Run the command: mbr2gpt /validate
  3. If the returned validation command ends successfully, you can convert this disk; if the error message Error disk geometry -1 appears, it is very likely that there are multiple disks connected to your computer. Run the diskpart -> disklist command to determine the disk numbers. A particular disk can be verified by its disk number with the command: mbr2gpt /validate /disk:0.
  4. To convert the partition table of a disk, run mbr2gpt /convert or with the disk number mbr2gpt /convert /disk:0.
  5. The mbr2gpt tool creates a new EFI boot partition from the system partition, copies the Windows boot loader into it and converts the partition table to GPT (existing partitions remain intact). Just go to the Windows 10 installation screen, click Update on the drive selection screen and start installing Windows 10 on the selected partition.

MBR2GPT Known issues

After converting the mbr2gpt partition table, BitLocker and Hyper-V (available in Pro and Enterprise versions of Windows 10) are the most common issues.

If you have converted the system drive and try to activate BitLocker, you may receive an error message: The system cannot find the specified file. This is probably an issue related to the Windows Recovery Environment (WinRE).

Try renaming the %windir%System32RecoveryReAgent.xml file and activating BitLocker (a new ReAgent.xml will be created automatically).

An error may also occur when running Hyper-V virtual machines:

The virtual machine cannot start because the hypervisor is not working.

To resolve this error, you must enable the Hyper-V autostart in the BCD configuration:

BCDEDIT /Set {current} hypervisorlaunch type auto

If you try to convert disks with older versions of Windows (7/8.1), the tool generates the error message that mbr2gpt cannot install new boot files. In this case, it is recommended to perform an in-place upgrade to Windows 10 first and then just convert the partition table.

Related Tags:

mbr2gpt disk layout validation failedconvert mbr to gptconvert mbr to gpt without data loss windows 10mbr2gpt cannot find os partitionmbr2gpt conversion failedhow to convert mbr to gpt without operating systemconvert mbr to gpt windows 10convert mbr to gpt windows 10 installation

Leave a Reply

Your email address will not be published.