“du” Reports Less Space Utilization than “df”
Applies to:
Oracle Cloud Infrastructure
Linux x86-64
Symptoms:
The du
(/usr/bin/du
) and df
(/bin/df
) commands output display different storage space utilization values:
[opc@instance ~]$ sudo df -k / Filesystem 1k-blocks Used Available Use% Mounted on /dev/sda3 9288792 8672768 144120 99% / [opc@instance ~]$ sudo du -xsk / 2132542 /
In the example above, df
reports 8.6 GBs (8672768 KBs) to have been used on the root (/
) filesystem, whereas du
reports only 2.1 GBs (2132542 KBs) to have been used.
Cause:
The df
command reports how many disk blocks are used, whilst du
traverses the filesystem and reports the actual number of blocks used (directory by directory), including any space used by existing files.
Tagged:
0