On my CentOS server, both of the commands are showing different usage for disk / , df shows this output:
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 16G 14G 952M 94% /
/dev/xvda6 996M 258M 687M 28% /tmp
/dev/xvda3 16G 6.5G 8.3G 45% /var
/dev/xvda1 251M 25M 213M 11% /boot
tmpfs 4.0G 0 4.0G 0% /dev/shm
and du -sh shows
6.9M /bin/
15M /boot/
123M /etc
212K /home/
233M /lib
27M /lib64/
16K /lost+found/
8.0K /media/
8.0K /mnt/
399M /opt/
959M /root/
35M /sbin/
8.0K /srv/
0 /sys/
2.5G /usr/
4.2G total
Also tried with NCDU tool, which reports only 5.6GB usage.
How to find hidden disk space?
See if you have any deleted files still in use
There's a lengthy explanation to be found in any number of blogposts online with a quick search, but the basic gist is this:
If I create a 1 GB sparse file,
du
will show 1 GB, butdf
will show zero usage. If I have a 1 GB file open in some program and delete it,df
will still show 1 GB of usage until all references to the inode are closed, butdu
will never find the file to display it.df is file system usage which includes files, and other structures that support the files such as journal etc. du only shows the file size sum which will mostly be less. the difference will depend how long the filesystem has been in use, the filesystem itself, etc.