File system blocks alignment

Dag-Erling Smørgrav des at des.no
Wed Jan 6 11:36:34 UTC 2010


"Svein Skogen" <svein-listmail at stillbilde.net> writes:
> Dag-Erling Smørgrav <des at des.no> writes:
> > Or just default to 4 kB or even 8 kB, which has zero performance impact
> > (either way) for disks with 512 B sectors.
> I'd like it to be tunable.

It already *is* tunable, and always has been - it's just a matter of
selecting the correct offsets and sizes when you partition the disk /
array, and using the correct newfs parameters.

The problem is the default alignment used by fdisk, gpart etc.  Fdisk
aligns slices on cylinder boundaries, even though cylinders are just a
figment of the drive firmware's imagination.  Sysinstall is even worse,
since (IIRC) it *forces* cylinder alignment unless you select expert
mode and type in the correct numbers.  Marcel described the situation
for gpart somewhere else in this thread.

As for newfs, the defaults are fine as long as the filesystem doesn't
fill up to the point where UFS starts using fragments - but when it
does, you're in trouble anyway, so there's no point in overriding the
defaults unless it makes sense for your data: a filesystem used mostly
to store large files may benefit from increased block / fragment sizes,
but remember to keep the 8:1 ratio.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-arch mailing list