Thursday 25 February 2016

Reclaiming disk space / shrinking VMDK disks

For linux: Using the cat for linux we can recover white space by reclaiming unused blocks with:

cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill

The same can be achieved on Windows with sdelete:

sdelete -c C:\

Now within the ESXI shell we can issue:

And then use vmkfstools -punchzero your-disk.vmdk

If you are using VMWare Player / Workstation you can use vmware-vdiskmanager.exe instead (within the VMWare Worksation program files) like follows:

vmware-vdiskmanager.exe -k "D:\path\to\your.vmdk"

0 comments:

Post a Comment