Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I tried to shrink the size of a VMware virtual disk by doing what I do with AIM/EC2/Xen images: use sdelete -c to clear the empty space on a drive. However, for VMware, this actually expands the size of the drive. It went from 2.7 gig to 4 gig.

So then I tried using VMware-vdiskmanager -k to shrink the drive. It did shrink but to only 3.8 gig.

If you've added then deleted a lot files from a VMware disk, how do you shrink it back down to its smallest size?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

The best way to do it is to use VMware Converter 4 to do a V2V while specifying a reduced disk size. Your mileage may vary depending on the type of OS - it's fine for Windows platforms - Linux support is relatively new.

share|improve this answer
    
This works, it's not ideal but it is the easiest suggestion thus far - It's a bit heavy handed and I got it wrong the first time I tried; ended up stripping out the vmware tools. Thanks for solving my problem! –  Tony Lee Oct 21 '09 at 18:29

One simple, but slow way is to create a new disk, then use a disk cloning tool that works at the filesystem level to copy from the expanded disk to the new disk. Once you have finished the cloning, then delete the original disk.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.