glabel "force sectorsize" patch

Ivan Voras ivoras at freebsd.org
Sun Aug 8 01:58:05 UTC 2010


Hi,

In order to help users having 4k sector drives which the system
recognizes as 512 byte sector drives, I'm proposing a patch to glabel
which enables it to use a forced sector size for its native-labeled
providers. It is naturally only usable with glabel-native labels
(those created by "glabel label") and not partition and file system
labels because we cannot add arbitrary new fields to metadata of those
types.

The patch is here:

http://people.freebsd.org/~ivoras/diffs/glabel_ssize.patch

It's tested with UFS+SU and a forced 4k sector size - apparently there
are no problems here. Here's how a dumpfs output looks like from the
test file system with completely default newfs options (except SU):

magic   19540119 (UFS2) time    Sun Aug  8 03:40:47 2010
superblock location     65536   id      [ 4c5e0ab3 41c7e8d9 ]
ncg     7       size    524287  blocks  514774
bsize   16384   shift   14      mask    0xffffc000
fsize   4096    shift   12      mask    0xfffff000
frag    4       shift   2       fsbtodb 3
minfree 8%      optim   time    symlinklen 120
maxbsize 16384  maxbpg  2048    maxcontig 8     contigsumsize 8
nbfree  128690  ndir    2       nifree  150972  nffree  12
bpg     21567   fpg     86268   ipg     21568   unrefs  0
nindir  2048    inopb   64      maxfilesize     140806241583103
sbsize  4096    cgsize  16384   csaddr  1376    cssize  4096
sblkno  20      cblkno  24      iblkno  28      dblkno  1376
cgrotor 0       fmod    0       ronly   0       clean   1
avgfpdir 64     avgfilesize 16384
flags   soft-updates
fsmnt   /mt
volname         swuid   0

This is a pre-commit review request and also a call for testers :)

This mechanism is a band-aid until there's a better way of dealing
with 4k drives.


More information about the freebsd-hackers mailing list