Shirnking vmware virtual disk(vmdk) to reclaim unused space using command line


Virtual machine virtual disk grows very huge over time despite the fact that the guest os is not taking the space shown by the vmware virtual disk files.

This examples shows how to reclaim unused space using command line tools like vmware-mount and vmware-vdiskmanager.

The size of the virtual machine partitions, output of ls from the guest os


The total used space is only 10gb or so


The size of the virtual disk files on the host



To list the partition on a virtual partition use vmware-mount -p

ex: vmware-mount -p /u02/vm/vm_test_for_prod_handson/vm_test_for_prod_handson.vmdk

Partition has to be mounted to prepare it for shrinking, create a folder to mount the virtual machine partition

mkdir /tmp/vm

Mount the virtual disk partition

vmware-mount /u02/vm/vm_test_for_prod_handson/vm_test_for_prod_handson.vmdk 1 /tmp/vm (This will mount the first partition)








Now start preparing partition for shrinking

vmware-vdiskmanager -p /tmp/vm

After preparing is completed  unmount the partition

ex: vmware-vdiskmanager -d /tmp/vm

When all virtual partitions are prepared, unmount  partitions and start shrinking .

ex: vmware-vdiskmanager -k /u02/vm/vm_test_for_prod_handson/vm_test_for_prod_handson.vmdk

  

Virtual disk file size after shirnking 



Comments

Popular posts from this blog

Error processing request - Contact your application administrator apex 20.1

APP-FND-01436: List of Values cannot find any values for you to choose error from concurrent request program parameter (R12 12.1.3)

WEB ADI - issues encountered during initial access