When you try to extend
unallocated space of C drive of Windows 2022 Virtual Machine (VM), Recovery
partition will lie between both C and unallocated space and it blocks the
extend of the drive.
So please follow the below
steps to fix it.
2. Disable the recovery Partition
using below command
Note: Please
make sure you are not disabling recovery partion if we didn't disable it we
can't able to re-create recovery partition after disk expansion
3.Open command prompt with
elevation mode.
C:\Windows\system32>reagentc /disable
C:\Windows\system32>reagentc /info
4. Backup the files which is in the Folder "C:\Windows\System32\Recovery"
Note: Check show hidden files and uncheck the hide
protected Operating system files option to view the folder /files
5. Go to diskpart in
command prompt
Diskpart> lis dis ( It will list the disks)
Note down whether
disk is GPT or MBR.
Diskpart> Sel dis 0 (It will select the disk 0)
Diskpart> lis par ( It will show the partitions available
on disk)
Note down the size
of the recovery partition in my device it is 600MB)
Diskpart> Sel
par 3 (Here select which disk (Recovery disk) you want change id)
Diskpart> delete partition override
6. Extend the
unlocated partition without drive letter
7. After deleting recovery partition expand the drive with free space keeping
600 MB space for recovery partition
8. After expanding drive with free space we need to re-create recovery partition
in 600 MB space, Right click unallocated volume and create new simple volume
without assigning drive letter (Format : NTFS, Volume label : System reserved )
9 . MBR partition table has id's integer (ID should be 27)
Diskpart> det par ( It will show the details of partition)
Diskpart> lis dis (
It will list the disks)
Diskpart> Sel dis 0 ( It will select the disk 0)
Diskpart> Sel par 3 ( Here select which disk (Recovery
disk) you want change id)
Diskpart> set id=27 ( It will change Type to 27) //Note :
if the disk format is GPT, SET ID=de94bba4-06d1-4d40-a16a-bfd50179d6ac
Diskpart> det par ( it will show the details of the Partition
now type should be 27)
Diskpart> Exit
10. Check if backed up files
are available in "C:\Windows\System32\Recovery" if
not restore it.
11. Enable the recovery Partition
using below command
C:\Windows\system32>reagentc
/enable (It will enable the recovery Partition)
12. Open view files and uncheck show hidden files and check the hide protected Operating system files and click OK.