I have a Windows XP VM which had a thick provisioned 20GB HDD with only 10GB being used. With the VM powered off I ran vmkfstools -i XPTICK.vmdk -d thin XPTHIN.vmdk and ended up with a thin provisioned disk, which shows 19,827,710 as Size and 20,971,520 as Provisioned Size. When I power up the VM, it’s showing 10 of HDD space being used. Is there another way to recover the unused space? ESXi5.5 U2 standalone Thank you
If zeroing the free disk space (sdelete with the -z option) didn't cleanup enough free adjacent clusters, i.e. the data on the virtual file system is spread across the partition, there's unfortunately not much vmkfstools can do. In such a case you may need to use e.g. VMware Converter and run a Volume Based (Advanced options) V2V conversion.
André
Did you cleanup the guest OS prior to run vmkfstools, i.e. did you defragment the guest OS and zero out unused disk space?
André
I defragmented the drive, but didn't zero it out. What tool should be used for that?
-K --punchzero ?
Thanks
You need a tool that writes zeroes within the guest OS's filesystem itself. A well known tool for this is SDelete.
After zeroing out the guest file system, you may then use vmkfstools with the --punchzero option to reclaim the zeroed disk space.
André
Thank you.
can I run vmkfstools --punchzero XPTHIN.vmdk once SDelete finishes or I need to run through a conversion one more time?
The --punchzero option is made for thin provisioned virtual disks, so you should be able to reclaim the disk space using the command after zeroing out the guest. However, don't expect a reduction all the way down to the guest's used disk space. Defragmenting will help, but may not reorganize/relocate files on the virtual disk.
André
I ran SDelete inside the guest OS and then vmkfstools --punchzero thin.vmdk
no space recovered
If zeroing the free disk space (sdelete with the -z option) didn't cleanup enough free adjacent clusters, i.e. the data on the virtual file system is spread across the partition, there's unfortunately not much vmkfstools can do. In such a case you may need to use e.g. VMware Converter and run a Volume Based (Advanced options) V2V conversion.
André