Extract Drivers From Recovery Partition
When you are working with Visual Machines (VMs) and fixed hard disks it can happen that you run out of space. In such cases it comes in handy that you can simply extend the existing virtual hard disk. Since Windows Server 2012R2 and Windows 8.1 this is even possible while the VM is running. After extending the VHDX you just need to go into Disk Management and expand your partition. That’s the theory at least. However in a non lab environment things might look a little different.
More often than not, the partition you want to extend is blocked by a “Recovery Partition”. Blocked because you can only extend your existing partition with unallocated space directly to the right of the partition you want to extend. In our case there is a recovery partition in between and therefor the primary partition (C:) cannot be extended. How to open hard disk without screwdriver. This happens because Windows 10 creates the recovery partition after your primary partition so it can easily be extended.
Windows Partition Layout
The Windows 10 UEFI parition layout looks like the following. First comes a System Partition containing the master boot record (MBR). Without the system parition you will not be able to start Windows. Follwing the system partition you have the Microsoft Reserved Parition (MSR) that manages the partitions itself. Then you have your primary Windows parition followed by the recovery parition containing tools and data to recover your Windows installation in case of failures.
No one has given me a solution to that problem, so I was wondering if there is a way to extract the drivers from the recovery partition.
Windows 10 UEFI Paritions
Deleting the Recovery Partition
We can now go ahead and delete the recovery partition to make room for our primary Windows Partition. You can delete the recovery parition with DISKPART using the following commands from an admin commandline.
We can now go ahead and extend our Windows Parition to consume the free space. You should however leave about 500MB room so we can recreate our recovery parition.
If you do not need your recovery environment you can stop here and enjoy your new disk space. However I highly recommend recreating the just deleted recovery enviroment. That way in case of a system failure you can easly troubleshoot and restore your system. To create a new recovery partition we first must format the remaining 500MB free space accordingly. Windows recognizes the recovery partition by the static unique id de94bba4-06d1-4d40-a16a-bfd50179d6ac and the GPT attribute bit 0x8000000000000001.
We now have a partition that can host the Windows Recovery Environment (WinRE). In the next step we are going to extract the WinRE from the Windows Installation media and copy it to the just created volume.
Extrating the Windows Recovery Environment (WinRE)
Download the .ISO image for your version of Windows our insert your installation disk and mount it by right clicking the image. Bloque autocad 3d fogones. We are now going to mount the installation files and copy the winre.wim file from Windows PE. Open an admin powershell and enter the following commands.
Installing the Windows Recovery Enviroment (WinRE)
Now that we have the WinRE image we can install it in our new recovery volume (R:). We are going to copy the image and then tell Windows were to find it.
Thats it. We are all done and you can now use your recovery enviroment as before.