tunefs question

Bruce Evans brde at optusnet.com.au
Fri Jun 8 02:45:37 UTC 2007


On Thu, 7 Jun 2007, Richard Noorlandt wrote:

> While reading a bit about tunefs I noticed that UFS reserves 8% of the drive
> space for the root user and the system. However, I don't really understand
> what this space is actually used for. From the tunefs man page I understand
> that it is primarily used to guard against fragmentation, and that's about
> it. Is this the only thing that the reserved space is used for?

Yes.  Laying out files optimally is a hard problem, and leaving lots of
unused space simplifies the problem.

> And while I'm at it: what is the effect of the expected average file size
> option? What are the benefits and dangers of tweaking it?

Its main effect is to cause panics when it is set too high.  Similarly
for the average files per directory option -- set these so high that
their product overflows to cause undefined behaviour including panics.

Setting these options to non-overflowing values has subtle effects which
seem to be limited to limiting the number of directories per cylinder
group.  IMO, they are mainly debugging options for determining if the
subtle effects are ever large enough to be worth tuning for.  They are
documented mainly in a README or commit message.

> From the FreeBSD
> handbook I understand that the FS actually optimizes itself as time passes,
> but that's about all that's said about it.

No, ffs unoptimizes itself (becomes more fragmented) as time passes.
The reserved space limits the extent of the fragmentation or at least
the rate of growth of the fragmentation.  Fragmentation of old, nearly
full, ffs file systems can be very bad (maybe 10 times slower than a
new one).  Note that fsck only reports one sort of fragmentation which
is not the main one that slows down old file systems.

Bruce


More information about the freebsd-fs mailing list