Specifications
CHAPTER 6 Using Disks in a Virtual Machine
197
Preparing a Virtual Disk for Shrinking
Before you can shrink a virtual disk, you must prepare each volume on the disk for
shrinking. To prepare a volume, it must be located on a Windows host. First you must
mount the volume. To mount the volume, use the VMware DiskMount Utility, available
as a free download from the VMware Web site. For information about downloading
and using VMware DiskMount, see Shrinking Virtual Disks with VMware Virtual Disk
Manager on page 195.
VMware DiskMount mounts individual volumes of a virtual disk. For optimal shrinking
of a virtual disk, you should mount all the volumes and shrink them.
After you mount a virtual disk volume, use the virtual disk manager to prepare the disk
for shrinking. To prepare the volume mounted at the M drive for shrinking, use the
following:
vmware-vdiskmanager -p M:
Once the preparations are complete, unmount the volume. Repeat this process for
each volume of the virtual disk. After you prepare all the volumes for shrinking, you
can shrink the virtual disk.
Shrinking a Virtual Disk
To shrink a virtual disk, it must be located on a Windows host. Before you can shrink
the virtual disk, make sure you prepare all the volumes of the virtual disk for shrinking.
Then use the following:
vmware-vdiskmanager -k myDisk.vmdk
Remember, you cannot shrink a virtual disk if you preallocated all the disk space when
you created the virtual disk. You cannot shrink a physical (raw) disk.
You cannot shrink a virtual disk if the virtual machine has a snapshot. To keep the
virtual disk in its current state, simply remove the snapshot. To discard changes made
since you took the snapshot, revert to the snapshot.