From: Stephen Tweedie (sct@dcs.ed.ac.uk)
Date: 04/01/93


From: sct@dcs.ed.ac.uk (Stephen Tweedie)
Subject: Re: df and the ext2 filesystem
Date: 1 Apr 1993 22:21:26 GMT


>> I also lost 6M of space after creating a 101M partition using
>> mke2fs(ver 2c). I'm running 99pl7a kernel.

> I'm sure someone will correct me if I'm wrong, but doesn't the ext2fs (like
> other *nix systems) save up to 10% of the file system in reserve? In fact,
> I don't remember where I read this, but by telling mke2fs to not reserve
> that space can cause the speed of the file system to be drastically reduced.
> Don't know if that's true or not, maybe the maintainer of the code for
> ext2fs can correct us.

By default, the ext2fs reserves 5% of disk space for root. If the
filesystem becomes more than 95% full, then only root can continue to
write to it. You can change the ratio reserved by mke2fs by using the
"-m" command switch.

There are two reasons for this. First of all, disk performance does
degrade as the disk becomes very full; however, the new allocation
routines present in ext2fs-0.2d have not been around for long enough
to know just how well they perform under extreme conditions. As their
author, I have been using them for longer than anybody, and on a
fairly full filesystem; so far, all indications are that it does
indeed perform much better than the old system, even with very little
disk space available. It is certain that performance does degrade
with disk capacity, though. I would be very interested to hear how
other people find its performance under heavy load.

Secondly, reserving some of the disk space for root prevents users
from starving the system of disk space. Even just logging on to a
machine adds entries to various system files, potentially needing new
disk blocks. If a user fills up the filesystem then many system
utilities could get upset. If these daemons run as root, however,
then they can continue to function by using up the reserved disk
space.

Cheers,
 Stephen Tweedie.