Converting a disk from the Master Boot Record (MBR) to the GUID Partition Table (GPT) is often necessary when upgrading a system to support UEFI, enable Secure Boot, or use larger hard drives. While this process is usually straightforward, I encountered an unusual error on one machine.
Cannot find OS partition(s) for disk 0
Fortunately, this problem was easily resolved by reinstalling the Boot Configuration Data (BCD) in the MBR partition using the BCDboot tool. For more information on what this tool does, refer to the BCDboot documentation.
Note: Before proceeding, ensure you have a backup of the machine you’re repairing.
First, without leaving WinPE, let’s check the list of volumes in DiskPart.
diskpart
list volume
Next, reinstall the boot files. In this case, the Windows installation directory is on volume D:, and the MBR partition (the target) is C:.
D:\Windows\System32\bcdboot.exe D:\Windows /s C:
The conversion with MBR2GPT should proceed without any issues now.