[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 54
  • Last Modified:

Hyperv VHD

I am running hyperv 2008R2. Have a VHD which I want to reduce the size (not the physical but virtual size) because there is a lot of unused space in the VHD (running win2008R2).

Its a dynamically expanding disk. How do I return the free space to the physical hard drive?
0
sysadim
Asked:
sysadim
1 Solution
 
Gregory MillerGeneral ManagerCommented:
0
 
Cliff GaliherCommented:
Expanding a VHD is trivial, but shrinking one is another story. There is no supported way, and even un the "unsupported, but works"  category, there is no method I trust. The chances of data corruption is just too high.
0
 
MaheshArchitectCommented:
0
 
Svet PaperovIT ManagerCommented:
You have to compact the VHD file:
1. Shutdown the virtual machine
2. If you have snapshots you need to delete them and let the VHD merge before continuing
3. Open its Hyper-V Settings from the Hyper-V Manager;
4. Go to the Hide drive section and select Edit the VHD; Run Compact

Once compact is done your VHD will have the smallest size possible considering the data on it.

Since it’s a dynamic VHD with 2008 R2 there is no need to run defrag or Precompact (as for 2003) before compacting the file.
0
 
Seth SimmonsSr. Systems AdministratorCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

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