*HELP* Removed Empty Partition - Now Can't Upgrade to GPT or use Windows Recovery

Associate
Joined
22 Oct 2012
Posts
1,221
A few days ago I cleverly decided to remove unused space on my system drive to allow me to upgrade using the mbr2gpt utility (recommended 3 partitions or less).

This left the below (my system drive is disc 1):

rS7Eo6p.png


Now I've borked my windows recovery which can't load, while mbr2gpt won't run at all as it can't 'find os partition for disk 1'. Everything else works perfectly. Any ideas how I can fix this up, maybe just adding another set of unused space?

Things I've tried:
- Creating a recovery image in a folder within windows - this restores recovery but doesn't help the other issues
- Am currently imaging this drive to preserve it and allow me to try repairs using the image
 
Last edited:
Hang on, reread.
Is the second disc only added now for imaging purposes, or was it present when you first installed the system?
I wondered if this was an MBR deletion issue.

-edit
can you right click on C and set it to active?
 
Hang on, reread.
Is the second disc only added now for imaging purposes, or was it present when you first installed the system?
I wondered if this was an MBR deletion issue.

-edit
can you right click on C and set it to active?
Sorry I was a bit unclear and have edited. Drive 1 is my system drive and is what I’m trying to upgrade.

Yep drive 0 was not present previously and is only there because I’m imaging to it. I can set C as active yes, but isn't ‘system reserved’ supposed to be active usually?

EDIT: my bad the error mbr2gpt gives is actually 'mbr2gpt cannot find os partition for disk 1'

mbr2gpt and recovery info results below:

QSJZJGt.png
 
Last edited:
Looking at your disk layout it seems you've deleted the EFI partition, or haven't created one.

Creating/restoring it can be done but the instructions on how to do it are a bit to lengthy for a forum post, woshub.com has what seems like decent instructions and your search engine of choice will turn up others if you search for something like "restore windows 10 efi partition"
 
Last edited:
Looking at your disk layout it seems you've deleted the EFI partition, or haven't created one.

Creating/restoring it can be done but the instructions on how to do it are a bit to lengthy for a forum post, woshub.com has what seems like decent instructions and your search engine of choice will turn up others if you search for something like "restore windows 10 efi partition"

Thanks Murphy. My Windows install is MBR, so I don't have an EFI partition. But this is really close to what I suspect I need to do. Any ideas on restoring a partition on MBR?
 
So I'm guessing when you fist run mbr2gpt you ran it from inside windows rather than the WindowsRE environment? (please correct me if I've got that wrong:)) If so, like you say, the disk will still be MBR.

If that's the case you'll want to restore the WindowsRE environment first, have you tried (re)enabling it using "reagentc /enable"?
 
So I'm guessing when you fist run mbr2gpt you ran it from inside windows rather than the WindowsRE environment? (please correct me if I've got that wrong:)) If so, like you say, the disk will still be MBR.

If that's the case you'll want to restore the WindowsRE environment first, have you tried (re)enabling it using "reagentc /enable"?
Exactly right I gave mbr2gpt /validate a run, which gives the error above as no recovery volume exists. Other points:

- The disc is still MBR

- reagentc /enable doesn't work, it's disabled as there's no recovery sector.

- Using an image of the main drive, I recently managed to set a folder in C:\ as the recovery location:
*This worked okay and when I tried to upgrade to GPT from inside the new RE it all worked
*However the GPT drive didn't appear to be bootable, not being visible as a boot drive within UEFI and not not appearing bootable when I try and force the issue using the CSM option
 
So a GPT drive would be bootable if the EFI partition was there (most BIOS will treat any FAT32 partition as bootable if it finds a "bootx64.efi" file in a \EFI\BOOT folder) and mbr2gpt should've taken care of that by creating the required partitions.

When you converted the drive to GPT (i assume you've since reverted that by restoring the drive from a backup image?) can you remember if it created a 100MB FAT32 partition?

Having check myself i should've notice the recovery partition was empty (100% free), sorry. :) I'm guessing the content got hosed at some point in the backing up and restoring of things, either way it would probably be best to restore that first by temporarily assigning it a drive letter.
Open powershell and type/run
Code:
Get-Partition | Where-Object {$_.Type -Eq "Recovery"} | Set-Partition -NewDriveLetter R
that should let you create a folder called "Recovery" and a folder inside the Recovery folder called "WindowsRE", once you have a "R:\Recovery\WindowsRE" folder it's just a matter of copying the relevant files to it, do you have a "Winre.wim" file anywhere? If you do copy that along with "ReAgent.xml" and "boot.sdi" that should be in the same folder as the "Winre.wim" to the newly create folder "R:\Recovery\WindowsRE" folder and run...
Code:
Get-Partition | Where-Object {$_.Type -Eq "Recovery"} | Set-Partition -NewDriveLetter R
To remove the temporary drive letter and try rerunning "reagentc /enable", that should restore the recover partition to a workable state.
 
So a GPT drive would be bootable if the EFI partition was there (most BIOS will treat any FAT32 partition as bootable if it finds a "bootx64.efi" file in a \EFI\BOOT folder) and mbr2gpt should've taken care of that by creating the required partitions.

When you converted the drive to GPT (i assume you've since reverted that by restoring the drive from a backup image?) can you remember if it created a 100MB FAT32 partition?
I'm sorry I don't recall if it had a FAT32 partition at all. But the thing didn't appear to be bootable. I did eventually kill that imahge with another backup of my system drive: currently I've got the original SSD system drive and now two backups to play with.

Having check myself i should've notice the recovery partition was empty (100% free), sorry. :) I'm guessing the content got hosed at some point in the backing up and restoring of things,
It's a weird one. All I did with this original drive was extend the C partition into some empty space which wasn't allocated to anything. I don't get how that killed the recovery partition but as you say it appears to be empty.

...either way it would probably be best to restore that first by temporarily assigning it a drive letter.


Open powershell and type/run
Code:
Get-Partition | Where-Object {$_.Type -Eq "Recovery"} | Set-Partition -NewDriveLetter R
that should let you create a folder called "Recovery" and a folder inside the Recovery folder called "WindowsRE", once you have a "R:\Recovery\WindowsRE" folder it's just a matter of copying the relevant files to it, do you have a "Winre.wim" file anywhere? If you do copy that along with "ReAgent.xml" and "boot.sdi" that should be in the same folder as the "Winre.wim" to the newly create folder "R:\Recovery\WindowsRE" folder and run...
Code:
Get-Partition | Where-Object {$_.Type -Eq "Recovery"} | Set-Partition -NewDriveLetter R
To remove the temporary drive letter and try rerunning "reagentc /enable", that should restore the recover partition to a workable state.
I've got install.wim which I extracted from a recovery disc and converted from install.esd? Will try and locate the three you mentioned and follow your instructions.
 
Last edited:
Sorry that second command, the one to remove the drive letter once you're done copying the files should be..
Code:
Get-Partition | Where-Object {$_.Type -Eq "Recovery"} | Remove-PartitionAccessPath -AccessPath R:
Sorry.

EDIT: If you can't find those files it's not much of a problem, you'll just need to copy them from the install media: Create a temporary folder somewhere, C:\Mount will do, then mount your install.wim using powershell command..
Code:
Mount-WindowsImage -ImagePath "<path to your install.wim>\install.wim" -Name 'Windows 10 <Pro or Home>' -Path "<path to where you created the temporary folder>"
That will take a while to mount the image, once it's done you can navigate to "<your temporary folder>Windows\System32\Recovery" and winre.wim and ReAgent.xml will be there, boot.sdi can either be found in the boot folder on the ISO or in the system32 directory.

Once you've copied those unmount the image using..
Code:
Dismount-WindowsImage -Path "<path to your temporary folder>" -Discard
 
Last edited:
Open powershell and type/run
Code:
Get-Partition | Where-Object {$_.Type -Eq "Recovery"} | Set-Partition -NewDriveLetter R
Heya Murphy, had a bit of free time so gave this a run and weirdly this code doesn't assign anything a drive letter.

Maybe my 'recovery partition' isn't what it seems to be? I noted in another programme, the partition doesn't seem to have a label:

9h04UCl.png
 
Last edited:
Okay @Murphy, I think I've accidentally fixed the problem using your guidance as inspiration.

  1. Within AOMEI partition manager, I tried to assign the label 'Recovery' to the partition which windows diskmgmt thinks is a recovery partition but AOMEI sees as blankly labelled (image in previous post)
  2. However this *still* didn't allow the powershell drive letter assignation code to run for some reason
  3. On a whim I decided to try 'reagentc /enable' and bugger me but it magically worked!
  4. I exited and tried some recovery options and they are indeed all there now
So perhaps, somehow back then when I deleted this free space, it reshuffled partitions, label start points or... something and killed the recovery partition. I suspect all Windows actually needed was to be told this was indeed the recovery partition?

Recovery still looks live after reboot and it even seems I can go about my original goal of converting the disc to GPT (after of course, another backup):

kL2yR1s.png
 
Last edited:
The recovery partition should be a specific type ID (0x27 on MBR disks as shown in your AOMEI partition manager screenshot) so powershell should've assigned a drive letter, not sure why it wouldn't have but either way i guess it's not to important now you seem to have sorted it.

Just make sure to run MBR2GPT from the recovery environment.
 
Back
Top Bottom