Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 May 2004 02:09:50 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Michael Conlen <meconlen@obfuscated.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Disk Usage
Message-ID:  <20040505000950.GA56915@falcon.midgard.homeip.net>
In-Reply-To: <527A4BE3-9E1D-11D8-BD41-00039367611E@obfuscated.net>
References:  <527A4BE3-9E1D-11D8-BD41-00039367611E@obfuscated.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 04, 2004 at 06:49:38PM -0400, Michael Conlen wrote:
> I have a NFS server running FreeBSD-4.9-RELEASE. It's run fine for 
> several months with five FreeBSD 4.9 systems mounting it's filesystems. 
> Suddenly something started using disk space at the rate of 10 GB/hour 
> on one of the filesystems (which has exported directories). The catch 
> is that a du -k shows a total usage for that file system of much less 
> than df -k. du -k essentially shows the disk usage before the available 
> space started to disappear! Normally I'd presume someone's hiding files 
> under a mount point when I see this but nothings mounted on a directory 
> in this filesystem. Upon reboot the space is not used anymore, df -k 
> and du -k report similar values.
> 
> Quite simply odd. Some other details... ...this has happened twice in 
> one day, and the rate of "ghost" disk usage is constant and identical 
> in both graphs. The file server is used to serve files to clustered web 
> servers. There's considerable write activity to the NFS server all the 
> time (40-60Mbit/sec) and moderate read access (~10Mbit/sec).
> 
> Any ideas what would cause the df -k and du -k discrepancy?


That sounds like some program keeps one or more files open and writes
to it while the directory entry for the file has been removed. 
(Probably some log file which is kept open, but it might be something
else.)
Space used by a file is not marked as free until all directory entries
referring to the file has been removed AND no program has the file
open.
This is the normal cause for df/du discrepancies that you describe.


-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040505000950.GA56915>