Specifications
CHAPTER 6 Using Disks in a Virtual Machine
195
Shrinking Virtual Disks with VMware Virtual Disk Manager
If the virtual disk is located on a Windows host, you can use the virtual disk manager to
prepare and shrink virtual disks. You cannot use the virtual disk manager to prepare or
shrink virtual disks located on a Linux host. You cannot use the virtual disk manager to
shrink physical disks. Shrinking a virtual disk does not reduce the maximum capacity
of the virtual disk itself. For more information about shrinking, see Defragmenting and
Shrinking Virtual Disks on page 168.
Caution: 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.
You must prepare each volume of the virtual disk for shrinking before you can shrink
the disk. To prepare a volume for shrinking, you must first mount it. To mount the
volume, use the VMware DiskMount Utility, available as a free download from the
VMware Web site. Go to www.vmware.com/download/diskmount.html.
The VMware DiskMount user’s manual is available from the VMware Web site at
www.vmware.com/pdf/VMwareDiskMount.pdf. It contains instructions on mounting
and unmounting virtual disk volumes with DiskMount.
VMware DiskMount mounts individual volumes of a virtual disk. For optimal shrinking
of a virtual disk, you should mount all the volumes and prepare them for shrinking.
After you mount a virtual disk volume, use the virtual disk manager to prepare the
volume for shrinking. Once you prepare a volume, unmount it, then repeat the
process for each volume of the virtual disk. After you prepare all the volumes of the
virtual disk, you can shrink the virtual disk. For examples, see Preparing a Virtual Disk
for Shrinking on page 197 and Shrinking a Virtual Disk on page 197.
Examples Using the VMware Virtual Disk Manager
The following examples illustrate how to use the virtual disk manager. You run the
virtual disk manager from a command prompt.
Creating a Virtual Disk
To create a new virtual disk, use the following:
vmware-vdiskmanager -c -t 0 -s 40GB -a ide myDisk.vmdk
This creates a 40GB IDE virtual disk named myDisk.vmdk. The virtual disk is
contained in a single .vmdk file. The disk space is not preallocated.