Monday, 8 December 2014

Reclaim the space on storage from a VM

When files are deleted within the  guest VM running on a NFS storage mounted on ESXi, basically only the inode entries are updated with info that these blocks can be reused. The actual NFS storage does not free up this space.

http://sjmeyers.blogspot.com/2011/05/how-to-reclaim-disk-space-using-vmware.html

Above blog, talks about reclaiming via vmware tools and  sdelete.

On linux, you can do this

on linux try this on user VM , to if free space is 32G, then 

df -h 

/mnt/local_disk1 has 32G free, you can zero out about 32G. 

dd if=/dev/zero of=/mnt/local_disk${i}/zero.out bs=$((4*1024*1024)) count=8000 && rm /mnt/disk1/zero.out
then delete zero.out