Link to home
Start Free TrialLog in
Avatar of Castlewood
Castlewood

asked on

Why "Dynamically Expanding VHDX" didn't expand the drive when needed?

I have a 2012r2 VM created with the size of 300G in Dynamically Expanding VHDX on a 2012r2 Hyper-V host. In the Disk Management of this VM, it shows C: drive has 100G in C: drive and another 200G is unallocated.
The C drive currently has 50G free. I want to restore a backup files of 80G from a NAS to this VM and I thought even it currently has only 50G free space but it should automatically dynamically expand when needed. Unfortunately it didn't. The restore process ended up failed. What I don't understand is, why "Dynamically Expanding VHDX" didn't expand the drive when needed. Can you help understand this?
Thanks.
Avatar of PCLANVADWPB
PCLANVADWPB
Flag of United States of America image

If I am reading this right, you have a 300GB VHDX that is partitioned as 100GB for C ( using 50GB ) and the rest is unallocated.

So step 2 is go to Start, type compmgmt.msc, run it, then choose Disk Management, on the right, right click on C: and Extend Volume, and Next, Next and finish. You now have a 300GB C-Drive using 50GB of space.

Dynamically Expanding the volume worked. It expanded the volume, you just needed to expand the partition inside the volume yourself.

Now you can play.
Avatar of Castlewood
Castlewood

ASKER

"You now have a 300GB C-Drive using 50GB of space."
so at this point, even my C-Drivei has a volume of 300G, I actually only use 50G of space and also the VHDX file is 50G in size, correct?
Correct.  Since it is a dynamic VHD, drive C is now a 300GB drive with 50GB of disk space used.  So the VHD size should be around 50GB give or take.

Keep in mind that VHD does not shrink on its own.  If you add 20GB to C-Drive and then delete it, even though you are still only using 50GB, the size of the VHD will now grow to 70GB.  From time to time compacting a VHD is a good thing to do.  To compact, you go to the same place you expanded earlier.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.