Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Dec 2001 03:00:43 +0100 (CET)
From:      BOUWSMA Beery <freebsd-user@netscum.dyndns.dk>
To:        freebsd-hackers@freebsd.org, freebsd-doc@freebsd.org
Subject:   Re: newfs and the -b/-f default values
Message-ID:  <200112310200.fBV20hb00257@beerswilling.netscum.dyndns.dk>

next in thread | raw e-mail | index | archive | help
[replies sent directly to me may timeout and bounce, since I'm not
 online as often as I should be, but I'll check the list archives]

Not so long ago, I pondered...

> So I just now went back into -current and used `newfs -N' with
> different parameters, and as far as I could see, in fact, the
> new defaults of -b 16384 -f 2048 that the man pages referred to
> several times were not in effect.

I think I know what's happening.  That partition I tried to newfs
already had fsize and bsize in the disklabel, and those values
were (re)used.  Another partition I re-newfs'ed had zero in the
disklabel, though they had been earlier newfs'ed with the old
defaults, so when I tried to newfs this one, I got the new defaults
instead, as promised by the man page.


> So, is there a good reason why the -stable and -current man pages
> for newfs do not seem to match the reality of what the program does?

I think the man pages need to be enhanced to make mention of what
happens with non-zero disklabel values.  In rereading the man pages
in both -stable and -current, I got no obvious hint that this made
any difference.  I probably should have known better, but...

In particular, I'd suggest wording similar to what follows, to make
this more clear:

     -b block-size
             The block size of the file system, in bytes.  It must be a power
             of 2.  The default size is 16384 bytes, and the smallest allow-
             able size is 4096 bytes.  If the disklabel contains a non-zero
             bsize, that value will be used unless a different value is
             explicitly specified.  The optimal block:fragment ratio is
             8:1.  Other ratios are possible, but are not recommended, and may
             produce unpredictable results.
[...]
     -f frag-size
             The fragment size of the file system in bytes.  It must be a
             power of two ranging in value between blocksize/8 and blocksize.
             The default is 2048 bytes.  If the disklabel contains a non-
             zero fsize, that value will be used unless a different value
             is specified.
[...]
(From the -current man page for newfs: )
EXAMPLES
           newfs /dev/ad3s1a

     Creates a new ufs file system on ad3s1a.  If the disklabel values for
     bsize and fsize are zero, newfs will use a block size of 16384 bytes,
     a fragment size of 2048 bytes and the largest possible number of
     cylinders per group.  These values tend to produce better performance
     for most applications than the historical defaults (8192 byte block
     size and 1024 byte fragment size).  This large fragment size may lead to
     large amounts of wasted space on filesystems that contain a large number
     of small files.  Otherwise, newfs will use the existing disklabel values
     of bsize and fsize for the block size and fragment size respectively.



Assuming that this does reflect reality.  I'm sure someone with a much
better grip on the english language than I can state it far more
succinctly, just as someone with a much better grip on newfs than I
could far more accurately describe reality.



thanks
barry bouwsma


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112310200.fBV20hb00257>