Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Shrink VHDX Server 2012 Hyper V 2012

Posted on 2016-08-05
4
Medium Priority
?
29 Views
Last Modified: 2016-08-10
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?
0
Comment
Question by:dannyfccs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 41745041
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.
1
 
LVL 17

Expert Comment

by:bigeven2002
ID: 41745097
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.
0
 

Accepted Solution

by:
dannyfccs earned 0 total points
ID: 41745145
I found this was the best option, open power shell elevated as administrator.

type in diskpart

select vdisk FILE="C:\HyperV\Virtual Hard Disks\vm01.vhdx"  (vhdx location)
compact vdisk

worked a treat
0
 

Author Closing Comment

by:dannyfccs
ID: 41750102
it was the best solution
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question