Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2007 13:49:21 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        bv@wjv.com
Cc:        freebsd-fs@freebsd.org, Paul Kupfer <kupfer@ldc.upenn.edu>
Subject:   Re: du and df discrepancy
Message-ID:  <86bqayezb2.fsf@ds4.des.no>
In-Reply-To: <20071016162948.GA79131@wjv.com> (Bill Vermillion's message of "Tue\, 16 Oct 2007 12\:29\:48 -0400")
References:  <20071016114035.O64828@lorax.ldc.upenn.edu> <20071016162948.GA79131@wjv.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Bill Vermillion <bv@wjv.com> writes:
> I've seen it many times in my XX years of Unix work.
>
> du - shows the amount of blocks used by the system
> df - shows the amunt of space it thinks is being used.
>
> The latter will compute the length of sparse files so df will show
> less free space than du.  Sparse file will have blocks of no data in
> them.  These are typically created by database programs.

Utterly wrong.

df will show the amount of space used in the file system, including
space used by files that have no directory entry (e.g. temporary files
which the application unlinks immediately after opening)

du will show the amount of space used by the files it is able to find by
traversing the directories specified on the command line.

Both will DTRT for sparse files.

Note that when running 'du *' in the root of a file system, the shell
will most likely not include directories and files whose names begin
with a dot in its expansion of '*'.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



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