You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

“du” Reports Less Space Utilization than “df”

edited Jun 16, 2023 3:26PM in Linux 1 comment

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.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!