Mailinglist Archive: opensuse (1468 mails)

< Previous Next >
Re: [opensuse] df says partition is 100% full, but du shows only 20% is used
On Wed, 03 Jun 2009 21:44:20 -0700, Randall R Schulz <rschulz@xxxxxxxxx> wrote:

On Wednesday June 3 2009, Ben Kevan wrote:
I have a machine here where df shows a mount point being 100% full.
However, when you do a du -h it shows that only 1.1G of the 5G is
being used.
How can I make sure that df is reporting accuratly?

They report different things. Df looks at file system-wide index
information that the file system keeps track of during ongoing
operations. Du traverses the directory structure from the starting
point(s) you specify as arguments and adds up the space used by each
file it encounters.

If you really do start du at the root of a file system and it has access
to all the directories it encounters (guaranteed only if run as root),
then it is accurate, with one possible exception: If a file is "sparse"
(regions that have never been explicitly written but only seeked over
during writing) it will over-report usage based on the file's size
under the assumption that ever logical sector of the file occupies a
physical sector on the disk.

If there are no sparse files, du sees the whole file system and there's
a discrepancy w.r.t. df, then there could be some form of corruption in
the file system, as unlikely as that is in practice.

The most likely source of discrepancy is that you're not really applying
du to the entire file system (a generalization of Rajko's suggestion).

Randall Schulz

But a 4GB difference in reporting? That's massive.. When I get into work i'll check the trash, but I think someone may have moved a file that was open by an app. So it may still be loaded in the write buffers. I did lsof +L1 <directory> and noticed a file marked <deleted> that was 0 bytes.

Thanks for the explination Randall and Rajko

I say never be complete. I say stop being perfect. I say let's evolve. Let the chips fall where they may. -Fight Club
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups