1

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?

user9517
  • 114,104
  • 20
  • 206
  • 289
Tony Lee
  • 113
  • 1
  • 5

2 Answers2

2

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.

Helvick
  • 19,579
  • 4
  • 37
  • 55
  • 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
0

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.

Zoredache
  • 128,755
  • 40
  • 271
  • 413