1

This question already has an answer here:

I have strange issue, df shows rootfs is 100% full but du shows it's 25% used. So I check on the unlinked files from the rootfs using lsof +aL1 / and it does not show me any deleted/unlinked files from rootfs. I tried find /proc/*/fd -ls | grep '(deleted)' too and it does not show any unlinked file from rootfs!

Inode usage is only at 9%

marked as duplicate by Gilles linux Jan 6 '16 at 23:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    Can you post the outputs of both df -l and du -s /? – David King Jan 6 '16 at 15:28
  • 4
    Use a bind mount to check for files hidden under other mountpoints. – frostschutz Jan 6 '16 at 15:35
  • @frostschutz Thanks a lot, I was able to figure out the file after doing a bind-mount. Could you make it an Answer so I can select it and upvote :) – Soumyadip DM Jan 6 '16 at 16:16
2

As suggested in the comments, a bind mount might hide files and directories from the du command. But there might be something else as well...

The following might be revealing:

% strace -e statfs df /         
statfs("/", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=6288727, f_bfree=4705740, f_bavail=4380531, f_files=1605632, f_ffree=1412254, f_fsid={1878967121, -50608953}, f_namelen=255, f_frsize=4096}) = 0
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda2       25154908 6331948  17522124  27% /
+++ exited with 0 +++

Note that there is a difference between f_bfree and f_bavail. From man statfs:

fsblkcnt_t f_bfree;   /* Free blocks in filesystem */
fsblkcnt_t f_bavail;  /* Free blocks available to
                         unprivileged user */

The Used column is based on a calculation: it is total block count - free block count.

Not the answer you're looking for? Browse other questions tagged or ask your own question.