Changes

Jump to: navigation, search

How to Reduce the Size of a VMware Server 2.0 Virtual Disk

1,087 bytes added, 20:19, 27 October 2008
no edit summary
This HowTo covers the steps necessary to shrink a VMware Server 2.0 virtual disk. Two techniques are available, one involving VMware Tools and the another using the commandline ''vmware-vdiskmanager'' tool), both of which will be covered in this guide.
Before beginning this process it is important to understand a few requirementspoints:
* At least one of the virtual machines Shrinking currently using the virtual disk must have the only appears to be supported on Windows hosts. The VMware Tools package installeddocumentation states that shrinking is not available on Linux hosts.
* It is only possible to reduce the size of a virtual disk which was initially configured as ''growable''. ''Pre-allocated'' virtual disks cannot be reduced in size. To shrink the size of a pre-allocated disk it must first be converted to a growable disk (see [[How to Convert a VMware Pre-allocated Virtual Disk to a Growable Virtual Disk]] for steps on how to perform this conversion).
* If the virtual disk is configured as ''Independent'' it must be in ''Persistent Mode''.
* Shrinking involves discarding the majority of any unallocated space within the virtual disk. As such, it is not possible to dictate the amount by which the disk should be shrunk. If  * Shrinking reduces the shrink process leaves insufficient amount of space, additional space may be subsequently be allocated as outlined in [[How to Increase a virtual disk currently occupies on the Size host system. It does not reduce the size of the disk as far as any guest operating systems using the disk are concerned. When more disk space is needed by a guest, VMware Server 2increases the size of the virtual disk image to accommodate the guest.0 Virtual Disk]]This process is repeated in increments as more space is needed until the maximum specified virtual disk size is reached.
== Shrinking a Virtual Disk from the Command Line ==
The size of a VMware virtual disk may be reduced from the command line using the ''vmware-vdiskmanager''. If the disk to be resized shrunk is pre-allocated it must first be convereted converted to a growable disk, the syntax for which is:
vmware-vdiskmanager -r ''<oldfilename>.vmdk'' -t ''<type> <newfilename>.vmdk''
</pre>
The next step is to prepare the virtual disk for shrinking. To do this, the disk must be mounted with a drive letter on the Windows host. This can be achieved using the ''VMware DiskMount Tool'' which is available for download from [http://www.vmware.com/download/ws/#utilities www.vmware.com/download/ws/#utilities]. Once installed, a virtual disk may be mounted using a command similar to the following: <pre>vmware-mount G: "D:\VirtualMachines\Win2008\Win2008.vmdk"</pre> Once the virtual disk is mounted using a suitable drive letter (G: in the above example), the disk must be prepared for shrinking: <pre>vmware-vdiskmanager -p G:</pre> Once the disk has been convertedand prepared, the size may be reduced, using the ''-k'' command line option. For example:
<pre>
vmware-vdiskmanager -k new.vmdk
</pre>
 
To subsequently unmount the virtual disk from the host, run the following ''vmware-mount'' command:
 
<pre>
vmware-mount G: /d
</pre>
1,798
edits

Navigation menu