MBR2GPT.EXE is a built-in console tool that converts a disk from the Master Boot Record (MBR) to the GUID Partition Table (GPT) partition style without modifying or deleting data on the disk.
When you run MBR2GPT to validate the disk before converting it to GPT, the following error may occur:
Cannot find OS partition(s) for disk 0
Cause
There may be multiple reasons for the error “Cannot find OS partition(s) for disk #,” but incorrect entries in the Boot Configuration Database is the usual cause. Another reason is that the system may have booted in UEFI mode (even though the disk is MBR), and “BCD” doesn’t exist in the MBR boot path — i.e., \Boot\BCD
.
The BCD may have entries pointing to a non-existent device. Or, the BCD file may be missing from the \Boot\BCD
folder because the system uses the UEFI boot path — \EFI\Microsoft\Boot
.
Resolution
To resolve the error “Cannot find OS partition(s) for disk #,” follow these steps:
First, rebuild the BCD. To do so, run the following commands from an admin Command Prompt.
bcdboot C:\Windows /s C: /f ALL
If the above command runs successfully, open Disk Management and set the C drive and the active partition if it’s not already the active partition. To do so, right-click the C drive and choose “Mark partition as active.”
Note:
After marking the C drive as the active partition, you can optionally delete the System Reserved partition (if you have one) using diskpart after a reboot.
Next, access your BIOS settings and enable “Legacy” boot mode.
Then, validate and convert the disk to GPT using MBR2GPT. Once booted into Windows using legacy mode, run MBR2GPT and validate the disk to see if any errors are reported. To do so, use this syntax:
Syntax:
MBR2GPT /validate [/disk:<diskNumber>] [/allowFullOS]
Example:
MBR2GPT /validate /allowfullos
(If the disk number is not specified, the system disk is used.)
Disk validation using MBR2GPT should now run successfully.
Now, convert the disk to GPT using the following command:
MBR2GPT /convert /allowfullos
It should show the message “MBR2GPT: Conversion completed successfully” on the output screen.
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 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 Call WinReReapir to repair WinRE MBR2GPT: Failed to update ReAgent.xml, please try to manually disable and enable WinRE. MBR2GPT: Before the new system can boot properly you need to switch the firmware to boot to UEFI mode!
Now, switch to “UEFI” or “UEFI only” mode in the BIOS and boot into Windows. That’s it.
Note:
If the bcdboot
command mentioned above doesn’t fix the issue, analyze the C:\Windows\Setupact.log
file. In some cases, you need to boot into WinRE, rename \Boot\BCD
, and then run the bootrec /rebuildbcd
command to regenerate a new BCD.
One small request: If you liked this post, please share this?
One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!