Specifications

Table Of Contents
VMware, Inc. 145
Chapter 6 Using Disks in a Virtual Machine
vmware-vdiskmanager -n myDisk.vmdk myNewDisk.vmdk
To!rename!the!disk!and!locate!it!in!a!different!directory,!use:
vmware-vdiskmanager -n myDisk.vmdk ..\<new>\<path>\myNewDisk.vmdk
NOTE The!paths!used!in!these!examples!assume!a!Microsoft!Windows!host.
To!locate!the!disk!in!a!different!directory!but!keep!the!same!name,!use:
vmware-vdiskmanager -n myDisk.vmdk ..\<new>\<path>\myDisk.vmdk
After!you!rename!or!relocate!the!virtual!disk,!add!it!back!to!any!virtual!machines!that!
use!it.!Choose!VM!>!Settings,!click!Add.!Follow!the!Wizard!to!add!this!existing!virtual!
disk.
Defragmenting a Virtual Disk
To!defragment!a!virtual!disk,!use!the!following:
vmware-vdiskmanager -d myDisk.vmdk
You!cannot!defragment!a!virtual!disk!if!you!preallocated!all!the!disk!space!when!you!
created!the!virtual!disk.!You!cannot!defragment!a!physical!disk.
Preparing a Virtual Disk for Shrinking
Before!you!can!shrink!a!virtual!disk,!you!must!prepare!each!volume!on!the!disk!for!
shrinking.!The!disk!must!be!located!on!a!Windows!host.!First!you!must!mount!the!
volume.!To!mount!the!volume,!use!the!VMware!DiskMount!Utility,!available!with!
VMware!Server.!For!information!about!how!to!use
!VMware!DiskMount,!see!
“Shrinking!Virtual!Disks!with!VMware!Virtual!Disk!Manager!on!page 143.
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.