• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 91
  • Last Modified:

Hyper v 2012 compac not working

Hi,
Having some serious issues trying to compaq VHDx'S

Tried the GUI , powershell (http://blogs.technet.com/b/askcore/archive/2012/09/20/compacting-a-dynamically-expanding-virtual-hard-disk-in-windows-server-2012.aspx)

I dont get any error message after compacting & compac terminates OK

But when checking the size or hyper v, nothing has changed

Any tricks?

Cheers
0
defrey
Asked:
defrey
  • 4
  • 4
1 Solution
 
David Johnson, CD, MVPOwnerCommented:
how much free space is on the physical disk and in the virtual disk?  Perhaps there is nothing that can be compacted
0
 
defreyAuthor Commented:
Hi David,

VHD size is 256GB, used space is only 73.GB

Available free space on Physical 760GB

Should be able to do it!
0
 
Cliff GaliherCommented:
Keep in mind that compacting a dynamic disk only shrinks the physical file by removing empty space at the end of the file. In some situations, where data was removed in such a way where the empty space is mid-file, compacting won't do much. It does *not* defragment the vhd(x) files first.
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
defreyAuthor Commented:
Is this case, I have got over 180GB that not needed, What would you recommend?
For quick backup, I need to bring the size down.
0
 
Cliff GaliherCommented:
There are server (aka expensive) defrag tools that can move data specifically for this purpose. Otherwise there isn't a lot you can do.
0
 
defreyAuthor Commented:
I am confused now, What does compacting VHD do?
0
 
Cliff GaliherCommented:
As I said above, it moved the "end" of the file to the last non-empty space, effectively removing any empty space at the end. If a lot of data was added to a dynamic disk causing it to grow, and then some of that data is removed, the empty space may be in the middle of the file, not the end, compacting does *not* rearrange blocks of data so it can remove that empty space.
0
 
defreyAuthor Commented:
Thanks Cliff, so I should be able to compac some of it without the expensive tools.

So, the question is why nothing get compacted when I try?

Cheers
0
 
Cliff GaliherCommented:
Given no error is occurring, my belief is that there is data at the end of the virtual disk, thus it is as compacted as it can be without a defrag, this isn't uncommon with dynamic disks; data had to be written to the drive to grow it to the size it is, so it is common that a small chunk of data remains at the end even when some data is later deleted.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now