Posted on September 14, 2017 · Posted in Windows 10

Converting MBR to GPT with MBR2GPT in Windows 10

In Windows 10 v1703 (Creators Update) a new console tool, mbr2gpt.exe, appeared that allows to convert an MBR (Master Boot Record) disk to a GPT (GUID Partition Table) disk without loss of data and deleting partitions on a disk. The tool can convert both a system disk with the installed Windows OS and a disk containing data. You can use the utility to convert the partition table both in Windows PE (Windows Preinstallation Environment), as well as a part of the upgrade process from Windows 7 to Windows 10, and directly in Windows 10.

Mbr2gpt allows you to convert the partition table from MBR to GPT in the following Windows 10 versions: 1507, 1511, v1607 and  higher (if the disk is converted offline from Windows 10 1703 image). Earlier OS versions (Windows 7, Windows 8 and Windows 8.1) are not officially supported.

Note. Earlier to convert a non-system disk from MBR to GPT without losing partitions, you could use a third-party tool gptgen, but to convert a system disk using gptgen, you need to format it.

The logics of Mbr2gpt while converting an MBR disk to a GPT is as follows:

  • Disk check
  • If there is no EFI (ESP) system partition, it is created using free space in one of the partitions
  • UEFI boot files are copied to the ESP partition
  • GPT metadata are applied
  • BCD boot file is updated

As you can see, the data in the existing partitions are not touched.

MBR2GPT uses the following syntax:

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

mbr2gpt utility in WIndows 10

  • /validate – the disk is only validated if the partition table can be converted (including the check of free space to store the primary and the secondary GPT table: 16 KB + 2 sectors in the beginning of the disk and 16 KB + 1 sector in the end)
  • /convert – starts converting the disk if the validation has been successful
  • /disk: — specifies the number of the disk to be converted into GPT. If the number is not set, the system disk will be converted (like Diskpart command: select disk system)
  • /logs: — shows the path to the directory where MBR2GPT should write logs. If the path is not set, %windir% folder is used. The log files are diagerr.xml, diagwrn.xml, setuperr.log and setupact.log
  • /map: — allows to specify additional partition table mappings between MBR and GPT. For example, /map:42={af9b60a0-1431-4f62-bc68-3311714a69ad}. The number of the MBR partition is specified in decimal notation, and GPT GUID contains delimiters. You can specify multiple mappings.
  • /allowFullOS – by default, MBR2GPT runs only in Windows PE. Using this key, you can run the tool in the full Windows environment

For example, let’s validate the current system disk for conversion from MBR to GPT.

mbr2gpt.exe /disk:0 /validate /Logs:C:\logs /allowFullOS

mbr to gpt converting - validation disk

The line MBR2GPT: Validation completed successfully shows that this disk can be converted.

Tip. If the disk is encrypted using BitLocker, decrypt it before conversion.

Start the conversion:

mbr2gpt.exe /convert /disk:0

MBR2GPT will now attempt to convert disk 0.
If conversion is successful the disk can only be booted in GPT mode.
These changes cannot be undone!
MBR2GPT: Attempting to convert disk 0
MBR2GPT: Retrieving layout of disk
MBR2GPT: Validating layout, disk sector size is: 512 bytes
MBR2GPT: Trying to shrink the system partition
MBR2GPT: Trying to shrink the OS partition
MBR2GPT: Creating the EFI system partition
MBR2GPT: Installing the new boot files
MBR2GPT: Performing the layout conversion
MBR2GPT: Migrating default boot entry
MBR2GPT: Adding recovery boot entry
MBR2GPT: Fixing drive letter mapping
MBR2GPT: Conversion completed successfully
MBR2GPT: Before the new system can boot properly you need to switch the firmware to boot to UEFI mode!

To make a computer boot from the new EFI partition, you have to change its settings to boot in the UEFI mode. Restart your computer and in the UEFI settings change the boot mode from Legacy (BIOS) to UEFI (Pure), then save the changes.

pure uefi mode

Windows 10 should boot successfully. Using msinfo32.exe you can make sure that Windows 10 has booted in the UEFI mode.

uefi bios mode status in windows 10

When using UEFI, users have the following advantages:

  1. You can create partitions with the size over 2 TB
  2. Protection of the startup environment with Secure Boot
  3. ELAM (Early Launch Antimalware) technology
  4. Device Guard and Credential Guard in Windows 10 Enterprise
  5. Measured Boot

Previous:
Next:
Related Articles