Solved

Hyper v 2012 compac not working

Posted on 2015-02-21
9
67 Views
Last Modified: 2015-03-12
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
Comment
Question by:defrey
  • 4
  • 4
9 Comments
 
LVL 79

Expert Comment

by:David Johnson, CD, MVP
ID: 40623873
how much free space is on the physical disk and in the virtual disk?  Perhaps there is nothing that can be compacted
0
 
LVL 1

Author Comment

by:defrey
ID: 40624075
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
 
LVL 57

Accepted Solution

by:
Cliff Galiher earned 500 total points
ID: 40624077
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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 1

Author Comment

by:defrey
ID: 40624082
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
 
LVL 57

Expert Comment

by:Cliff Galiher
ID: 40624092
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
 
LVL 1

Author Comment

by:defrey
ID: 40624100
I am confused now, What does compacting VHD do?
0
 
LVL 57

Expert Comment

by:Cliff Galiher
ID: 40624103
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
 
LVL 1

Author Comment

by:defrey
ID: 40624105
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
 
LVL 57

Expert Comment

by:Cliff Galiher
ID: 40624111
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

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

The reason that corporations and businesses use Windows servers is because it supports custom modifications to adapt to the business and what it needs. Most individual users won’t need such powerful options. Here I’ll explain how you can enable Wind…
A procedure for exporting installed hotfix details of remote computers using powershell
In this Micro Tutorial viewers will learn how they can get their files copied out from their unbootable system without need to use recovery services. As an example non-bootable Windows 2012R2 installation is used which has boot problems.
In this Micro Tutorial viewers will learn how to restore their server from Bare Metal Backup image created with Windows Server Backup feature. As an example Windows 2012R2 is used.

803 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