I have a CentOS 7.2 (minimal) VM running in a vSphere cluster, which has a 16G drive formatted as XFS under the default full-disk usage partitioning scheme from the CentOS installer. The system is running a test httpd service (all software from the default centos repos), but its space usage on disk is growing. This is in part from problematic apache error/access logs (2+GB in size), and removing these longs frees up some space. What is eating the drive space isn't so much a concern for me (I'll just nuke and pave this eventually). However, when I run df an du to check file sizes, I get a discrepancy and this is what's confusing.
First I run
df -h to view filesystem usage:
[root@svrhttp03 httpd]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos_svrhttp03-root 14G 4.8G 9.1G 35% / devtmpfs 902M 0 902M 0% /dev tmpfs 912M 0 912M 0% /dev/shm tmpfs 912M 97M 816M 11% /run tmpfs 912M 0 912M 0% /sys/fs/cgroup /dev/sda1 497M 169M 329M 34% /boot tmpfs 183M 0 183M 0% /run/user/0
This is showing 4.8G used on the root FS.
I then run the following to view the size of all items at the root of the filesystem:
[root@svrhttp03 httpd]# du -a -h -t 10K / 2> /dev/null | grep -v -E "[A-Z,a-z,0-9]/." | sort -h 16K /home 7.4M /root 31M /etc 97M /run 143M /boot 324M /var 1.3G /usr 1.9G /
This shows only 1.9G in use, and the reported size of all directories add up to ~1.9G, as expected.
So how can I find that ~2.9G discrepancy between what
du are claiming for data on disk?