Re: strange df output?

Jon Tombs (jon@gte.esi.us.es)
Sun, 2 Jun 1996 01:44:27 +0200 (MET DST)


Warner Losh said:
>
> : UFS usually reserves 10%, ext2 5%.
>
> I believe that 4.4-lite based systems reserve 5% now.
>
> : Part of the function of the reserved space is to make
> : sure there is enough free space to let the block placement algorithms
> : work efficiently.
>
> Put another way, these numbers are based on how well a hash table
> performs when the alpha of the table (its load) gets high. Most of
> these systems use a hash table to know what it can allocate.

I believe the BSD 10% is actually a lot simpller to explain, the (original)
algorithm trys to do various optimizationes, one is to find a contiguous
space to put the file in and another is to do so all in one track.
The chances of finding such a place in the file system (for files of more than
a few blocks) drops quite fast as the disk nears 100% full. So the OS wastes
time first to discover that there is no suitable place to write the file, and
secondly having to fragment the file on disk. An easy way to avoid too much
fragmentation is to simple leave 10% of the disk free.

Jon. <jon@gte.esi.us.es, http://www.esi.us.es/~jon>