Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / MBR2GPT: Converting MBR to GPT Disk in Windows 10

June 7, 2023 Windows 10

MBR2GPT: Converting MBR to GPT Disk in Windows 10

Mbr2gpt.exe is a new built-in Windows 10 console tool that allows you to convert a disk with the MBR (Master Boot Record) partition table to a GPT (GUID Partition Table) without data loss and without the need to delete existing partition. The mbr2gpt tool can be used to convert the partition table both in Windows PE (Windows Preinstallation Environment) and directly from the running Windows 10. You can use this tool to change the partition table from MBR to GPT both on the data (non system) disk and on the system disk, on which Windows 10 is installed (using the /allowFullOS option).

Contents:
  • How does the MBR2GPT Tool Work?
  • Convert Disk from MBR to GPT without Dara Loss from Windows 10
  • Converting MBR to GPT during Windows 10 Installation
  • MBR2GPT Known Issues

How does the MBR2GPT Tool Work?

The mbr2gpt.exe tool is part of the Windows 10 image, starting from build 1703 (Creators Update). You can use mbr2gpt to convert a disk from MBR to GPT in offline mode on earlier Windows 10 builds (1507, 1511 and 1607). Previous Windows versions (Win 7/8.1) are not officially supported.

Note. Earlier, a third-party tool gptgen, could be used to convert a non-system disk from MBR to GPT without losing existing partitions. But to convert a system disk, you had to completely clean up the disk, create GPT partition table and new partitions on it, and then perform a clean install of Windows 10.

The MBR2GPT documentation says, that the following conditions must be met to convert a disk partition table to GPT:

  • Current disk partition table is MBR;
  • There is free space on the disk for placing 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 is active (additional and logical partitions should be missing);
  • The BCD configuration must have a boot record pointing to a Windows partition.

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

  1. Disk check;
  2. If there is no EFI (ESP) system partition, it is created using free space from one of the partitions (if there is not enough free space, an error message will appear “cannot find room for the EFI system partition”);
  3. UEFI boot files are copied to the EFI partition;
  4. GPT metadata and partition table are applied to the disk (the MBR partition table is converted to GPT without losing data on existing partitions);
  5. The BCD bootloader configuration is updated.

The syntax of the MBR2GPT tool is:

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:— specifies the path to the directory where MBR2GPT should write log files. If the path is not set, the %windir% folder is used. The log files are diagerr.xml, diagwrn.xml, setuperr.log and setupact.log;
  • /map:— allows you 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 at once;
  • /allowFullOS– by default, the MBR2GPT can be used only in Windows PE. You can use the allowFullOS parameter in order to convert system disk directly from running Windows 10.  Using this key, you can run the tool in the full Windows environment. If you do not specify this parameter when using mbr2gpt from Windows, an error will appear: ERROR: MBR2GPT can only be used from the Windows Preinstallation Environment. Use /allowFullOS to override.

Convert Disk from MBR to GPT without Dara Loss from Windows 10

The disk conversion operation from the MBR to GPT is irreversible. Make sure your computer supports UEFI before converting.

Before converting the disk partition table, 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

MBR2GPT: Attempting to validate disk 0
MBR2GPT: Retrieving layout of disk
MBR2GPT: Validating layout, disk sector size is: 512

The line MBR2GPT: Validation completed successfully shows that this disk can be converted. The line MBR2GPT: Disk layout validation failed means that the disk cannot be converted, because it does not satisfy the conditions.

Another common error Cannot find OS partition (s) for disk 0 is most often associated with the use of a third-party bootloader or choosing a wrong disk to convert. You can also try to move the Windows boot files to the system partition (bcdboot c:\Windows /f bios /s c:), and check the entries for the WinRE environment in the BCD (reagentc /disable && reagentc /enable) are correct.

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

Now you can convert the partition table on the system disk:

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!

Converting a disk from MBR to GPT from installed Windows 10 is done in seconds.

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) and 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 BIOS Mode = UEFI.

uefi bios mode status in windows 10

Key benefits of moving to native UEFI mode and GPT partition table:

  • You can create a partition larger than 2 Tb size;
  • Protection of the boot environment with Secure Boot;
  • ELAM (Early Launch Antimalware) technology;
  • Device Guard and Credential Guard features in Windows 10 Enterprise;
  • Measured Boot

Converting MBR to GPT during Windows 10 Installation

You can use the mbr2gpt tools during Windows 10 installation. For example, you created a bootable UEFI flash drive, and are trying to install Windows 10 on a disk with an MBR partition table on a UEFI-based computer. In this case, an error will appear:

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

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

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

  1. Press the keys Shift+F10 on the Windows 10 setup screen to open the command prompt of the WinPE environment;
  2. Check if the disk partition table can be converted to GPT. Run the command: mbr2gpt /validate
  3. If the command returned Validation completed successful, you can convert this disk;mbr2gpt failed to retrieve geometry for disk
    If the error Failed to retrieve geometry for disk -1 appears, most likely you have several disks connected to your computer. Run the command diskpart -> list disk in order to identify disk numbers. You can validate a specific disk by the disk number with the command: mbr2gpt /validate /disk:0
  4. To convert a disk partition table run the command mbr2gpt /convert or with the disk number mbr2gpt /convert /disk:0mbr2gpt convert disk partition table during windows setup
  5. The mbr2gpt tool will create a new EFI system partition boot partition, copy the Windows bootloader to it and convert the partition table to GPT (existing partitions will be saved). You just have to switch to the Windows 10 Setup window, click the Refresh button in the disk selection screen and start installing Windows 10 on the selected partition.

MBR2GPT Known Issues

After converting the partition table using mbr2gpt, most often there are problems with BitLocker and Hyper-V (available in Pro and Enterprise Windows 10 editions).

If you converted you system disk and trying to enable BitLocker, you may receive an error message: The system cannot find the file specified. This is most likely the problem with the Windows Recovery Environment (WinRE).

Try to rename the file %windir%\System32\Recovery\ReAgent.xml and enable the BitLocker (a new ReAgent.xml file will be created automatically).

There may also be an error when starting Hyper-V virtual machines:

Virtual machine could not be started because the hypervisor is not running.

To fix this error, you need to enable Hyper-V autostart in the BCD configuration:

BCDEDIT /Set {current} hypervisorlaunchtype auto

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

3 comments
2
Facebook Twitter Google + Pinterest
previous post
How to Backup Active Directory Domain Controller?
next post
How to Clear RDP Connections History in Windows?

Related Reading

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

Installing Language Pack in Windows 10/11 with PowerShell

September 15, 2023

How to View and Change BIOS (UEFI) Settings...

September 13, 2023

3 comments

carlo March 25, 2019 - 12:47 pm

when done finish succesfully mbr to gpt with gpt gen and after restart the pc, show message intel chipset monitor etc..and disk failure, please insert media tod continue.

Reply
Francesco February 10, 2023 - 11:18 am

The on ly downside of this method is that once converted you most likely have this partitioning on the disk:
Recovery partition
System partition (C:)
EFI partition

This way you are no longer able to allocate extra space to C: (Windows OS) drive because it is “locked” between two partitions.
I tried to use GParted and shrink 150MB from the recovery partition, leaving unallocated space after it, but the mbr2gpt tool kept saying there is no space available for the EFI partition to be created.

However I did not try to leave unallocated space **before** the recovery partition. It maybe this way could work.

Reply
admin February 10, 2023 - 12:28 pm

You can move the system (or recovery) partition to the end of the disc. This allows you to expand your data partitions after you have increased the size of the hard disk (this usually happens with VMs).
https://woshub.com/extend-volume-blocked-by-windows-recovery-partition/

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Disable UAC Prompt for Specific Applications in Windows 10?
  • How to Download APPX File from Microsoft Store for Offline Installation?
  • Fix: Windows Cannot Connect to the Shared Printer
  • How to Clean Up Large System Volume Information Folder on Windows?
  • Fixing “Winload.efi is Missing or Contains Errors” in Windows 10
  • Windows Doesn’t Automatically Assign Drive Letters
  • How to Hide Installed Programs in Windows 10 and 11
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top