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

Resolve WSUS Server issue that gives "Cannot save configuration because the server is still processing"

This is a pretty infuriating error and can sometimes crop up as a result of running a "wsusutil reset" command. First of all, give the server some time, and then a bit more...  but you've probably already done this. These steps may help to resolve the situation: - Install Microsoft SQL Management Studio (free download) - Run SQL Management Studio and start to connect to the WSUS database - Enter this in the "Server Name" box:  \\.\pipe\MICROSOFT##WID\tsql\query - Expand the "Databases" tree - Right-click on "SUSDB" and choose "New Query" - Paste this query in:     UPDATE tbSingletonData     SET ResetStateMachineNeeded = 0 - You should see a message like "1 row affected", which is good - Quit SQL Management Studio - Open "Services" and restart the "WSUS Service" - Now, open WSUS

Logon Scripts in Group Policy not running

Problem  Was having difficulty with a logon script I had created and was deploying to users via Group Policy. The script was to customise printer settings for certain users. But it just wasn't running when the users would logon to their PCs. The GPO was applying properly, and I could run the script manually without issue. Cause It turns out that it was happening because, by default, logon scripts don't run for 5 mins after logon occurs on a Windows client PC. Solution This can be adjusted by setting the "Configure Logon Script Delay policy" to "Enabled" and then configuring a better delay. Note: if this policy is set to disabled or not configured, the default delay of 5 mins will apply. I initially set this delay to "0" but found that wasn't successful.  Perhaps the script needed a small delay. So I set it to "1" (1 minute) and it worked nicely. I must also note that during the troubleshooting process, I read many recommendations to e...

Convert Ruckus AP from Unleashed to ZoneDirector-managed

Here is the method to convert a Ruckus Unleashed AP to one which can be managed by a Ruckus ZoneDirector controller: - Login to https://support.ruckuswireless.com/ - Click "Downloads" - Choose the correct product, e.g. Ruckus R550 - Choose a "standalone" version along the lines of 118.2.0.0.875.bl7 or something similar - Agree to terms and download the software - Connect to the AP's IP address - It should open the setup wizard, showing "Unleashed Installation" - Click "Local Upgrade" - Choose the firmware image file you just downloaded - It will upload, process, and then be ready for upgrade when you click "Yes" - After this, the ZD should detect the new AP - The new AP will then need to be approved - The new AP will then be upgraded to the correct software by the ZD - The new AP will then reboot and should be ready to use - Don't forget that, for the ZD to even detect, let alone manage the new AP, it must have enough licenses