With virtual disks, at least these three levels are involved:
- partition or volume (often called drive) size
- virtual disk size
- virtual disk backing store size
When talking about shrinking disks, they usually explain about below steps, assuming there is a 1:1:1 mapping of the above and backing store of the disk is dynamically growing:
- defragment the files on a partition/volume
- zero-fill the non-used space
- shrink the virtual disk assuming it is a dynamically growing one
For various reasons, virtualisation environments can have pre-allocated virtual disks ensuring the space on the backing store is firmly reserved.
One such occasion can be in VMware (often required for instance with vSphere/ESXi/ESX based infrastructure, but can also be used in Workstation/Fusion/Player) or Virtual Box in fixed disk mode (default there is dynamic).
Here are some links that should me help shrink in those situations:
More on conversion:
–jeroen
PS: a useful tip by Joe C. Hecht on shrinking:
Oh… On shrinking VM Disks, I make a new growable disk, then use a utility to “smart copy” the partions to the new disk (then replace the disk files in the VM). The “smart copy” just copies the file system – IE what is used (I use an old copy of Paragon Hard Drive Manager). It works out a lot better than writing “zeros”. I then make a compressed image of the whole VM using rar5 compression with a 1GB dictionary size. I then have batch files that can unrar the VM’s on a moments notice (from a collection of over 300).