Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Mar 2003 09:33:00 +1000
From:      Warren Toomey <wkt@minnie.tuhs.org>
To:        Rob Clark <rpclark@tds.net>
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: Root filling up (((du & df giving different results)))
Message-ID:  <20030316233300.GA85862@minnie.tuhs.org>
In-Reply-To: <20030316180013.61be4469.rpclark@tds.net>
References:  <20030316180013.61be4469.rpclark@tds.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Mar 16, 2003 at 06:00:13PM -0500, Rob Clark wrote:
> Issue: Root filling up (((du & df giving different results)))
> Recently I've noticed a significant increase in the "Capacity" of "/" using df.
> However using "du" commands as shown below gives conflicting results with that
> of "df".  
> 
> i.e.,
> # du -kx / | sort -nr | head -20
> 45959   /
> ...
> 
> # df 
> Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
> /dev/ad0s1a    128990   105842    12830    89%    /

I can think of two issues here. 

1. du adds up the file sizes and gives you a result in 1K units. But,
   each file actually takes up an integral number of fragments. If your
   / fragment size is, say 4K, and you have a whole heap of small files,
   then du will report a total size which is much less than df.

2. You have a process running that has an open file descriptor to a file
   on / which has been unlinked (e.g rm'd). The process is still using
   the file, but the name no longer exists, and so du or ls won't show it.
   To test this, reboot the system and see if the disk space goes up.

   If you have /var on the same partition as /, then this can occur if
   you have deleted a log file which was still in use by a daemon process.

I'd say option 2 is the most likely here. You could also run fstat(1) and
see if you can spot any large open files on /.

Cheers,
	Warren

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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