RH9: discrepancy between free disk space info: df vs. du, why?

Ed Wilts ewilts at ewilts.org
Wed Jun 23 11:36:55 UTC 2004


On Wed, Jun 23, 2004 at 02:08:55AM -0400, Rade Trimceski wrote:
> I run java based simulations which can generate pretty big files (900MB
> ~ 1.2GB). Lets say that I reboot the machine, using df -h I see that I
> have 1.4GB free disk space, and I leave it running for 4 days. In the
> course of 4 days I create and delete about 40 to 70 files. After
> deleting all the simulation related files (after 4 days of uptime) df-h
> reports only about 123MB free disk space. However if I run du on / I can
> deduce that the free space is indeed 1.4GB. If I reboot the machine df
> -h reports 1.4GB.
> 
> My qeustion to you: what causes the discrepancy between what df and du
> report and how can I fix this without reboot? If I look at the df output
> where does my free disk space go when I delete all the files?

What typically causes this is open files.  If you delete an open file,
it doesn't really get deleted until it gets closed.  du won't count it
but df will.

To show you the open files, use lsof:

# lsof /

In order to fix it, you will need to shut down the application that has
the deleted open file or figure out how to tell the app to close it.
-- 
Ed Wilts, RHCE
Mounds View, MN, USA
mailto:ewilts at ewilts.org
Member #1, Red Hat Community Ambassador Program





More information about the redhat-list mailing list