Link to home
Start Free TrialLog in
Avatar of Daniel Forrester
Daniel Forrester

asked on

Shrink VHDX Server 2012 Hyper V 2012

I have an exchange server 2013 that I've recently free'd up lots of space on, it was 1.6 TB but is now 400Gb, I therefore thought if i compact the vhdx file through the disk management in Hyper V, it would then show as 400gb rather than 1.6TB but it hasnt changed, is there something i'm missing?
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

It depends on where the data is geometrically speaking on the disk.  You might have to defrag the disk.

Fastest thing might be to create another VHDX on another set of spindles, shut down exchange, move the database to that other VHDX.  Then try to shrink the drive and then move the VHDX back.
Hello, first things first, backup your data before proceeding.

In prior Hyper-V versions, you had to shutdown the VM and then run the pre-compact tool which would reorganize the data in the VHD file and zero out free space in the VHD, so as to make the actual compact process possible.  I think it is also this way in 2012 but not sure about 2012 R2.

So in addition to the defrag above, shutdown the VM, run the precompact tool (you may have to download it), then re-run the compact function in Hyper-V Manager.  With 1.6 TB, this process can take several hours.
ASKER CERTIFIED SOLUTION
Avatar of Daniel Forrester
Daniel Forrester

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Daniel Forrester
Daniel Forrester

ASKER

it was the best solution