Skip to main content

Unable to Extend Volume because the Windows Recovery Partition is in the way

I had to increase the space allocated to a customer's WSUS server VM that had run out of capacity and was keeling over. So I powered off the VM, added the extra capacity to the virtual hard disk, powered it back on, and went into Disk Management to extend the C: drive partition.  However, I discovered that because the Windows Recovery Partition was in between the C: partition and the new unallocated space (similar to the image below which I've copied from Woshub.com), I was unable to do an "Extend Volume" job.


The solution was to move the recovery partition.  This involves disabling it, deleting it, extending your partition as required, and then re-creating the recovery partition and enabling it.

Here are the steps involved:

Disable existing recovery partition:

You will need to disable the existing Windows recovery partition.

To do this, run this command from an admin command line/PowerShell:  reagentc /disable

If you get the error message "REAGENTC.EXE: Operation failed: 70" then you may need to increase space on your C: drive.

This is because the disable command moves the recovery partition into a file named Winre.wim and puts it in C:\Windows\System32\Recovery.


Delete the existing recovery partition:

Now run diskpart...

Use "list disk" to see disks in use and whether they are GPT or MBR

Use "select disk 0" to select the disk you want (using disk 0 in this example, may be different on your system)

Use "list partition" to list the partitions on the disk you selected

Use "select partition 4" to select the recovery partition (number 4 in this example, may be different on your system)

Use "delete partition override" once you're sure you've selected the recovery partition - be carefull!!


Extend your partition into the new, accessible unallocated space:

Open up disk management and you should see that the recovery partition is gone and you are free to extend your Windows partition.

When you do so, leave an amount of at least 1024 MB unused (I went for 2048 MB) which you will use for the new recovery partition.


Create the new recovery partition:

Then create a new "simple volume" using that unused space.  Format it but do not give it a drive letter.

Back in diskpart, use "list partition" to see the new recovery partition.

Select the new partition

On GPT disks you will need to change the partition ID to de94bba4-06d1-4d40-a16a-bfd50179d6ac which tells Windows that this is a recovery partition

To do this, run this command: set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac

You will also need to hide the drive and flag it as a required partition to do that we have to set a GPT attribute to 0x8000000000000001

To do this, run this command: gpt attributes=0x8000000000000001

On MBR disks you will need to change partition ID to 27 which will tell Windows that this is a recovery partition.

To do this, run this command: set id=27

Exit diskpart


Enable the new recovery partition:

Now you can re-enable the recovery partition.

To do this, run this command: reagentc /enable

This will move the Winre.wim file from C:\Windows\System32\Recovery into your new recovery partition.


Comments

Popular posts from this blog

Where are SCANPST.EXE and/or SCANOST.EXE?

I sometimes have to deal with customer computers whose Outlook PST or OST files have become corrupted.  Very often the fix is to run SCANPST.EXE on the offending PST/OST file.   However, every time I go to do this I forget where the two executable files are.  Here is where they are on a Vista machine running Office 2007: C:\Program Files\Microsoft Office\Office12 I hope this helps.

McAfee does my head in

I’ve said it before and I’ll say it again: to all intents and purposes installing McAfee Anti-virus software is pretty much as bad as getting a virus.  There, I said it.  Again. I’ve lost count of how many problems I’ve had with customer PCs over the years where the root of the problem was McAfee in one or another of its hideous incarnations.  But here’s one that’s fresh in my head because I’ve only just sorted it out… A customer had a PC that wouldn’t connect to the iTunes Store in iTunes.  He could do everything else with iTunes, just not connect to the store.  Actually, now I think of it he probably wouldn’t have been able to use the internet radio stations in iTunes either.  He could access the internet and send/receive emails just fine.  iTunes just refused to play ball.  When I ran the Diagnostics in iTunes I got an error –3221. Well what could cause this?  Probably a firewall I thought.  The customer had McAfee Security Center with VirusScan and Personal Firewall.  They also

APC PowerChute Network Shutdown - Authentication Phrase

​Was installing  APC PowerChute Network Shutdown (PCNS) on a customer’s server and couldn’t find a record of the Authentication Passphrase that I set ages back on their Smart UPSes Network Management 2 Card. So I went to reset it on the card and start anew… it took a lot of digging to find it on their particular release of firmware: Go into the UPS tab, then into “shutdown” inside the “Configuration” category: You may then need to change the passphrase being used on other servers. To do this, open up PCNS in your browser and click into the area shown below: