ESXi filesystem check

Quite often you will need to check the free space on a ESXi host wether prior to an upgrade or even just maintaining normal operation.

Once logoned onto the ESXi host via SSH (may need to enable SSH first) you run the below commands to query and free up filesystem space:

check for free disk space:

vdf -h

check which directories or disks need attention

Filesystem Size Used Avail Use% Mounted on
/dev/sda2 5G 2.5G 2.5G 50% /
/dev/sda1 99M 18M 77M 19% /boot
none 145M 0 145M 0% /dev/shm
/dev/sda3 2.0G 135M 1.7G 8% /var/log
[root@ESXihost01]#

If tmp is reported as being short of space, try deleting /tmp/ams-bbUsg.txt to see if it resolves:

rm /tmp/ams-bbUsg.txt

If var is reported as being short of space, try resetting the mili2 log if present:
cd /var/log/EMU/mili

>mili2d.log

If the above doesn’t resolve, look for large files and delete old logs as appropriate:
du -ah /var/ | sort -n | tail -n 30

Confirm space issue resolved using vdf -h