Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
df -k
/dev/sda6             25396228  21249088   2836240  89% /export
21G used

versus

du -sh /export 
3.4G    /export

The 3.4G is correct because we have removed all non essential file but free space reported by df is not consistent with the actual free space that should be there.

Why is this so?

share|improve this question

migrated from stackoverflow.com May 5 '11 at 10:37

3 Answers

up vote 7 down vote accepted

The files you removed are probably still opened by a process. Check:

lsof -a +L1 /export

I think this is because:

  • df checks blocks available (superblocks)
  • du totals up the space of each file.
share|improve this answer
Gareth, many thanks for this...Is there a way I can clear this online or will this require a reboot? – Bernard Mwagiru May 6 '11 at 13:52
Anyway, managed to kill the processes and freed disk space...thanks a lot! – Bernard Mwagiru May 6 '11 at 14:15

One or more applications have files open on /export, but the filenames themselves no longer exist (i.e. have been deleted).

share|improve this answer

They measure two similar but slightly different things. df measures capacity of a file system, and du measures a directory tree. For example, if you had the following:

 /dev/sda6 mounted on /exports
 /dev/sda7 mounted on /exports/extra

df of /exports only measures /dev/sda6, while a du of /exports would measure /dev/sda6 and /dev/sda7. There are some flags regarding crossing file system boundaries which would change the counts. The handling of symbolic links could also impact results.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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