Checking datastore usage for inconsistencies on VMFS and or NFS datastores.
Common causes for higher then expected datastore usage:
Old vm-support log bundles.
Virtual machines that are not being used and are not needed.
VMDKs that are no longer attached to vms but are remaining on the datastore.
Old log files that are no longer needed.
ISO files that were copied to the system.
ls gives data on individual files based on the difference between the end-of-file (the largest offset where data is written) and the beginning-of-file, whether or not blocks were actually allocated to the file.
A 10GB file (as reported by ls) may not have 10GB of data written to it.
ls -lahR > ls-R.txt
egrep -i "sesparse|flat|delta" ls-R.txt | awk {'print $5'}
egrep -i "sesparse|flat|delta" ls-R.txt | awk {'print $5'} | grep -i G
egrep -i "sesparse|flat|delta" ls-R.txt | awk {'print $5'} | grep -i G | wc -l
102
egrep -i "sesparse|flat|delta" ls-R.txt | awk {'print $5'} | grep -i G | head -102 | paste -sd+ - | bc
2664.28
=======================
du -shc *
<Snippet of an example>
.
.
80.6G <VM1>
65.6G <VM2>
65.6G <VM3>
51.9G <VM4>
65.6G <VM5>
139.2M <VM6>
2.4T total
=======================
df -h
This will look for files that are 3 directories down from the current location as well as files that are above 7 M
find . -maxdepth 3 -type f -size +7M -exec ls -lah {} + | sort -rh
If you are unable to determine what is consuming the disk space, use the find command to locate all files matching a given criteria.
For example, to find files within / that are larger than 10MB without traversing mount points, use the command:
find / -size +10M -exec du -h {} \; | less
To find files within /var/ that are larger than 1MB without traversing mount points, use the command:
find /var/ -size +1M -mount -exec du -h {} \; | less