Re: ext2 corruption??

Theodore Y. Ts'o (tytso@mit.edu)
Thu, 6 Aug 1998 13:38:28 -0400


Date: Thu, 06 Aug 1998 17:54:13 +0100 (GMT+0100)
From: Magnus & Tina <magnus@gol.com>

I have a problem with one of my disks.
I can't get back part of the unused space no matter
how I try. The /dev/sdb1 is never up to date.

I boot the /redhat as root and then e2fsck /dev/sdb1, mount it,
unmount it ... Nothing helps.
There is currently a difference of 102814.
Is this the way it should be?

Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/sdb1 1988924 1856767 29343 98% /

Yes, this is the way things should be.

What you're forgetting (or didn't know) is that roughly 5% of the disk
is set aside as "reserved space". That 5% cushion can be invaded only
by root. This serves two purposes. First of all, the filesystem is
more efficient about avoiding fragmented file if there is a at least
a certain amount of free space available to the block allocation
routines. Secondly, this allows critical system daemons (at least those
running as root) to still be able to do silly things like write syslog
files saying that a filesystem is full. :-)

You can determine how much space has been reserved using dumpe2fs; you
can set or reset the reserved block count using tune2fs. See the
relevant man pages for more details.

In any case, the df display subtracts out the reserved space when
display the amount of disk space available. Hence, there will still be
a small amount of space available for root processes to write even when
df reports that there are 0 blocks available.

(By the way, this is standard Unix behaviour; it's not unique to Linux.)

- Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html