On Tue, 11 Dec 2001, JW wrote:

> Can anyone explain this anomaly? Which one is correct, du or df ? Is
> there any other utility I can use to calculate free/taken space? And
> what is the cause of <which ever one is wrong> being wrong?

Both are correct!

df is showing all use. du only shows what use of files it sees.

In other words, if you have files that are opened and then deleted (and
still opened by another process) then du and df will disagree.

Anyways, I can easily reproduce this.

df:
/dev/wd0g      3069820  2832102    84226    97%    /home
du -s /home
2832102 /home

Created a huge file.

/dev/wd0g      3069820  3034898  -118570   104%    /home
3034898 /home

Opened it with "tail -f" and fstat shows it is open.

Then delete it. df still shows that it exists, but du(1) doesn't see it.
/dev/wd0g      3069820  3034898  -118570   104%    /home
2832226 /home

So I close the tail processes:
/dev/wd0g      3069820  2832226    84102    97%    /home

  Jeremy C. Reed
  http://www.reedmedia.net/
  http://bsd.reedmedia.net/  -- BSD news and resources
  http://www.isp-faq.com/    -- find answers to your questions







_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to