Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2001 08:53:22 -0600
From:      Mike Meyer <mwm@mired.org>
To:        Erik Rothwell <erothwell@callgtn.com>
Cc:        questions@freebsd.org
Subject:   Re: Discrepancies between 'df' and 'du'...
Message-ID:  <15325.28002.252462.816652@guru.mired.org>
In-Reply-To: <48585188@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Erik Rothwell <erothwell@callgtn.com> types:
> Hi folks,
> 
> I just noticed something really odd... if I run "df /var" I get this
> output:
> 
> Filesystem   1K-blocks     Used    Avail Capacity  Mounted on
> /dev/ad0s1e      99183    89342     1907    98%    /var]
> 
> However, if I do something like "du -skh /var" the result is:
> 
>  17M    /var
> 
> That's a rather significant difference. As far as I can tell, the contents
> of /var (not including symlinks to data on other filesystems) does not
> include more than 17MB worth of data... is there any obvious reason why df
> might report otherwise?

Du reports what it finds in the file system. Df reports what the file
systems says is there. If there are files in the file system that du
can't find, du won't report them but du will. The normal source of
such files is a log file that you've deleted but a daemon still has
open. Du won't be able to find it because there are no links to it in
the file system, but it'll stay in the file system until the daemon
closes the file.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Q: How do you make the gods laugh?		A: Tell them your plans.

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




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