VMware vSphere – reclaim unused space on thin provisioned disk

vmware_logo.jpg   Administrators sometimes make the erroneous assumption that thin provisioned disks will automatically shrink in size allocated by the vSphere hypervisor when files are deleted – while the operating system might consider a file deleted (removing all pointers in the file allocation table in Windows, for example) the hypervisor doesn’t know about this status change and thus doesn’t reclaim the space

# vmkfstools –punchzero <VMfile>.vmdk

To maximize the effectiveness of this technique you should use operating system tools to overwrite all free space in the guest with zeroes

Linux:             # dd if=/dev/zero of=/[path]/zeroes bs=4096 && rm -f /[path]/zeroes
Windows:        C:\sdelete -z [drive letter]

Leave a Reply

You must be logged in to post a comment.