Windows Partition Merge & WinRE Recovery Notes
This note documents the successful process used to merge the space from the old E: partition into C: while preserving and rebuilding the Windows Recovery Environment (WinRE).
Introduction: Why Windows Partition Merge Is Needed
Over time, a Windows disk can become inefficiently divided into multiple partitions. A common situation is that the system partition (C:) becomes nearly full while another partition, such as D: or E:, still has a large amount of unused space. A full C: drive can interfere with Windows updates, application installations, temporary files, virtual memory, and normal system operation.
In this case, the disk originally contained a relatively small C: partition of about 14 GB and a much larger E: partition of about 185 GB. Since the additional E: partition was no longer needed, the objective was to return its space to C: and create one much larger, more practical system partition.
Normally, this can be accomplished by deleting the unnecessary partition and extending C: into the resulting unallocated space. However, Windows can extend a partition only when the unallocated space is directly adjacent to the right side of that partition.
The original physical layout was:
[EFI] [MSR] [C:] [Recovery] [E:]
After E: was deallocated, the layout became:
[EFI] [MSR] [C:] [Recovery] [Unallocated Space]
The Windows Recovery Environment (WinRE) partition was therefore positioned between C: and the newly available space. Windows Disk Management cannot move this Recovery partition, so C: could not simply be extended into the large unallocated area.
The solution was to back up the existing WinRE files, remove the obstructing Recovery partition, extend C: into the available space, and then create a new Recovery partition at the end of the disk and restore WinRE.
The overall objective was:
BEFORE [EFI] [MSR] [C: ~14 GB] [Recovery] [E: ~185 GB] AFTER [EFI] [MSR] [C: ~199 GB] [Recovery ~1 GB]
This arrangement gives the Windows system partition substantially more usable space while preserving the EFI boot partition, Microsoft Reserved partition, and a functional Windows Recovery Environment.
1. Original Layout
[EFI 100 MB] [MSR 16 MB] [C: ~14 GB] [Recovery 593 MB] [E: ~185 GB]
After E: was deallocated:
[EFI] [MSR] [C:] [Recovery 593 MB] [~185 GB Unallocated]
The 593 MB Recovery partition prevented C: from being extended because Windows requires unallocated space to be directly adjacent to the right side of C:.
2. Identify the Active WinRE Partition
reagentc /info
The important result was:
Windows RE status: Enabled Windows RE location: \\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE
DiskPart was used to confirm the partition:
diskpart select disk 0 list partition
Partition 4 was confirmed as the 593 MB Recovery partition.
3. Mount the Existing Recovery Partition
diskpart select disk 0 select partition 4 assign letter=R exit
Verify the recovery files:
dir /a R:\Recovery\WindowsRE
The partition contained:
boot.sdi ReAgent.xml Winre.wim
Winre.wim was approximately 514 MB.
4. Back Up WinRE Before Deleting the Recovery Partition
Because C: initially had insufficient free space, a temporary partition was used to store the backup.
xcopy R:\Recovery\WindowsRE T:\WinRE_Backup\ /h /i /y
Verify hidden/system files with:
dir /a T:\WinRE_Backup
/h option copies hidden and system files. A normal dir may report no files because these files retain their hidden/system attributes. Use dir /a.
5. Delete the Old Recovery Partition
First verify the partition carefully:
diskpart select disk 0 select partition 4 detail partition
After confirming it was the 593 MB Recovery partition:
delete partition override
6. Make the Free Space Adjacent to C:
The temporary backup partition initially ended up between C: and the large unallocated region. The WinRE backup was therefore temporarily copied to C: after C: gained enough free space.
First extend C: into the immediately adjacent 593 MB:
diskpart select volume C extend exit
Check free space:
fsutil volume diskfree C:
Copy the temporary WinRE backup to C:
mkdir C:\WinRE_Backup xcopy T:\WinRE_Backup C:\WinRE_Backup\ /h /i /y dir /a C:\WinRE_Backup
After verifying Winre.wim, delete the temporary T: partition:
diskpart select volume T detail volume delete volume
7. Extend C: Across the Remaining Space
select volume C extend exit
C: grew from approximately 14 GB to approximately 199 GB.
8. Reserve About 1 GB for a New Recovery Partition
Shrink C: by 1 GB:
diskpart select volume C shrink desired=1024 minimum=1024 select disk 0 create partition primary format quick fs=ntfs label="Windows RE tools" assign letter=R exit
The layout was now approximately:
[EFI] [MSR] [C: ~198.9 GB] [Windows RE tools ~1 GB]
9. Restore the WinRE Files
mkdir R:\Recovery mkdir R:\Recovery\WindowsRE xcopy C:\WinRE_Backup R:\Recovery\WindowsRE\ /h /i /y dir /a R:\Recovery\WindowsRE
Verify that Winre.wim, boot.sdi, and ReAgent.xml are present.
10. Convert the New Partition to a Windows Recovery Partition
Verify the new ~1 GB partition number:
diskpart select disk 0 list partition select partition 4 detail partition
After confirming Partition 4 was the new 1023 MB Windows RE partition:
set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac gpt attributes=0x8000000000000001 exit
This changes the GPT partition type to the Windows Recovery partition type and applies the appropriate hidden/protected attributes.
11. Register and Enable WinRE
reagentc /setreimage /path R:\Recovery\WindowsRE reagentc /enable reagentc /info
Windows RE status: Enabled Windows RE location: \\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE
12. Final Layout
[EFI 100 MB] [MSR 16 MB] [C: ~198.9 GB] [Recovery ~1 GB]
| Partition | Purpose | Approx. Size |
|---|---|---|
| EFI | UEFI boot files | 100 MB |
| MSR | Microsoft Reserved Partition | 16 MB |
| C: | Windows / main data partition | ~198.9 GB |
| Recovery | Windows Recovery Environment | ~1 GB |
Final Cleanup
Before deleting the temporary backup, reboot Windows and verify:
reagentc /info
Confirm that WinRE remains Enabled and points to harddisk0\partition4\Recovery\WindowsRE.
After successful verification, the Recovery partition's temporary drive letter can be removed:
diskpart select disk 0 select partition 4 remove letter=R exit
Verify reagentc /info again. Only after WinRE remains enabled should the temporary backup be removed:
rmdir /s /q C:\WinRE_Backup
No comments:
Post a Comment