Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/newfs Fixes from and/or inspired by FreeBSD:



details:   https://anonhg.NetBSD.org/src/rev/cefef9d6e14f
branches:  trunk
changeset: 519916:cefef9d6e14f
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Dec 30 16:47:55 2001 +0000

description:
Fixes from and/or inspired by FreeBSD:
- Change the default cpg from 16 to 65536, which effectively means
  that the largest allowable value for cpg will be computed if it's
  not specified with -c or in the disklabel for that partition.
  This is much more convenient for users.
- Improve the description of the defaults for various options

diffstat:

 sbin/newfs/newfs.8 |  24 ++++++++++++++++++++----
 sbin/newfs/newfs.c |   6 +++---
 2 files changed, 23 insertions(+), 7 deletions(-)

diffs (87 lines):

diff -r 690d2b5bb047 -r cefef9d6e14f sbin/newfs/newfs.8
--- a/sbin/newfs/newfs.8        Sun Dec 30 16:41:29 2001 +0000
+++ b/sbin/newfs/newfs.8        Sun Dec 30 16:47:55 2001 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: newfs.8,v 1.36 2001/11/21 15:23:40 lukem Exp $
+.\"    $NetBSD: newfs.8,v 1.37 2001/12/30 16:47:55 lukem Exp $
 .\"
 .\" Copyright (c) 1983, 1987, 1991, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\"     @(#)newfs.8    8.6 (Berkeley) 5/3/95
 .\"
-.Dd November 22, 2001
+.Dd December 31, 2001
 .Dt NEWFS 8
 .Os
 .Sh NAME
@@ -173,9 +173,13 @@
 for more details on how to set this option.
 .It Fl b Ar block-size
 The block size of the file system, in bytes.
+It must be a power of two.
+The default size is 8192 bytes, and the smallest allowable size is 4096 bytes.
 .It Fl c Ar cpg
 The number of cylinders per cylinder group in a file system.
-The default value is 16.
+The default is to compute the maximum allowed by the other parameters.
+This value is dependent on a number of other parameters, in particular
+the block size and the number of bytes per inode.
 .It Fl d Ar rotdelay
 This specifies the expected time (in milliseconds) to service a transfer
 completion interrupt and initiate a new transfer on the same disk.
@@ -194,13 +198,25 @@
 for more details on how to set this option.
 .It Fl f Ar frag-size
 The fragment size of the file system in bytes.
+It must be a power of two ranging in value between
+.Ar block-size Ns /8
+and
+.Ar block-size .
+The default is 1024 bytes.
+The optimal
+.Ar block-size Ns : Ns Ar frag-size
+ratio is 8:1.
+Other ratios are possible, but are not recommended,
+and may produce unpredictable results.
 .It Fl g Ar avgfilesize
 The expected average file size for the file system.
 .It Fl h Ar avgfpdir
 The expected average number of files per directory on the file system.
 .It Fl i Ar bytes-per-inode
 This specifies the density of inodes in the file system.
-The default is to create an inode for each 4096 bytes of data space.
+The default is to create an inode for every
+.Pq 4 * Ar frag-size
+bytes of data space.
 If fewer inodes are desired, a larger number should be used;
 to create more inodes a smaller number should be given.
 .It Fl m Ar free-space
diff -r 690d2b5bb047 -r cefef9d6e14f sbin/newfs/newfs.c
--- a/sbin/newfs/newfs.c        Sun Dec 30 16:41:29 2001 +0000
+++ b/sbin/newfs/newfs.c        Sun Dec 30 16:47:55 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: newfs.c,v 1.50 2001/12/13 06:29:15 lukem Exp $ */
+/*     $NetBSD: newfs.c,v 1.51 2001/12/30 16:47:55 lukem Exp $ */
 
 /*
  * Copyright (c) 1983, 1989, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)newfs.c    8.13 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: newfs.c,v 1.50 2001/12/13 06:29:15 lukem Exp $");
+__RCSID("$NetBSD: newfs.c,v 1.51 2001/12/30 16:47:55 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -117,7 +117,7 @@
  * on a single cylinder. The default is to use 16 cylinders
  * per group.
  */
-#define        DESCPG          16      /* desired fs_cpg */
+#define        DESCPG          65536   /* desired fs_cpg ("infinity") */
 
 /*
  * ROTDELAY gives the minimum number of milliseconds to initiate



Home | Main Index | Thread Index | Old Index