Disk Usage

Erik Trulsson ertr1013 at student.uu.se
Tue May 4 17:09:54 PDT 2004


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 at student.uu.se


More information about the freebsd-questions mailing list