Granted this isn’t fun. But it’s virtual. We live in an era of exciting expandable disks!
first off start with a full disk. That’s great. In this case the host was proxmox. It doesn’t matter. You apparently have to shut down the VM to expand the disk. Other virtualizers don’t need that. But whatever.
now for the predictable fun. That recovery partition is in the way. Not sure why NTFS needs to be contiguous but here we are.
So now we are stuck. You Google how to expand NTFS drive, how to move recovery partition, how to make disk bigger!! All in vain as everyone is pushing these nifty partition mover programs that don’t run on server. Do you just nuke the partition and hope for the best?
No, we can back it up, delete it, expand our disk and recreate it!
Capture the partition
Dism /Capture-Image /ImageFile:C:\my-system-partition.wim /CaptureDir:S:\ /Name:"My system partition"
Microsoft DiskPart version 10.0.19041.3636
Copyright (C) Microsoft Corporation.
On computer: KOMPUTER
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 250 GB 200 GB
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Primary 50 MB 1024 KB
Partition 2 Primary 49 GB 51 MB
Partition 3 Recovery 522 MB 49 GB
DISKPART> select partition 3
Partition 3 is now the selected partition.
DISKPART> delete partition OVERRIDE
DiskPart successfully deleted the selected partition.
restore the partition
dism /Apply-Image /ImageFile:c:\my-system-partition.wim /Index:1 /ApplyDir:w:\
Then tag the partition back to being a Recovery partition.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Primary 50 MB 1024 KB
Partition 2 Primary 249 GB 51 MB
Partition 3 Primary 600 MB 249 GB
DISKPART> select partition 3
Partition 3 is now the selected partition.
DISKPART> set id=27
DiskPart successfully set the partition ID.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Primary 50 MB 1024 KB
Partition 2 Primary 249 GB 51 MB
* Partition 3 Recovery 600 MB 249 GB
DISKPART>
depending on the version the command may fail setting type 27, so try:
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
and there we go!
One big happy drive! 🎉
Linking just for reference, because Microsoft has a recommended way to automate the recovery partition backup/restore using reagentc:
https://support.microsoft.com/en-us/topic/kb5028997-instructions-to-manually-resize-your-partition-to-install-the-winre-update-400faa27-9343-461c-ada9-24c8229763bf
Yup, came here to comment this. I’ve had to do this on a number of servers at work. Microsoft also botched a Windows Update that required an end user to do this stuff just so a Windows Update would install… https://support.microsoft.com/en-us/topic/kb5028997-instructions-to-manually-resize-your-partition-to-install-the-winre-update-400faa27-9343-461c-ada9-24c8229763bf