aboutsummaryrefslogtreecommitdiff
path: root/sbin/newfs
diff options
context:
space:
mode:
authorGreg Lehey <grog@FreeBSD.org>1998-09-29 23:20:04 +0000
committerGreg Lehey <grog@FreeBSD.org>1998-09-29 23:20:04 +0000
commit11ee80a991b8114581804939eb1f3f7657c501b5 (patch)
tree0afad80784909613dc81d97018015378cfae5885 /sbin/newfs
parente68e908bda6d0bbb959f9e223a5e274df61bd419 (diff)
downloadsrc-11ee80a991b8114581804939eb1f3f7657c501b5.tar.gz
src-11ee80a991b8114581804939eb1f3f7657c501b5.zip
Don't require an argument for -v flag
Correct checks for null special file names Add Usage entry for -v flag Get terminology straight in man page Reviewed by: bde
Notes
Notes: svn path=/head/; revision=39791
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/newfs.813
-rw-r--r--sbin/newfs/newfs.c16
2 files changed, 18 insertions, 11 deletions
diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8
index 9653c137a8b2..afb46a55267e 100644
--- a/sbin/newfs/newfs.8
+++ b/sbin/newfs/newfs.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)newfs.8 8.6 (Berkeley) 5/3/95
-.\" $Id: newfs.8,v 1.15 1998/07/15 06:28:04 charnier Exp $
+.\" $Id: newfs.8,v 1.17 1998/09/11 07:08:49 grog Exp $
.\"
.Dd May 3, 1995
.Dt NEWFS 8
@@ -92,7 +92,12 @@ or
the disk must be labeled using
.Xr disklabel 8 .
.Nm Newfs
-builds a file system on the specified special device.
+builds a file system on the specified special file. (We often refer to the
+.Dq special file
+as the
+.Dq disk ,
+although the special file need not be a physical disk. In fact, it need not
+even be special.)
Typically the defaults are reasonable, however
.Nm
has numerous options to allow the defaults to be selectively overridden.
@@ -214,12 +219,10 @@ for more details on how to set this option.
.It Fl s Ar size
The size of the file system in sectors.
.It Fl v
-Specify that the slice does not contain any partitions, and that
+Specify that the special device does not contain any partitions, and that
.Nm
should treat the whole slice as the file system. This option is useful for
synthetic disks such as
-.Nm ccd
-and
.Nm vinum.
.El
.Pp
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index 580067e01072..bd2ab0d884e9 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)newfs.c 8.13 (Berkeley) 5/1/95";
#endif
static const char rcsid[] =
- "$Id: newfs.c,v 1.22 1998/07/20 12:04:42 bde Exp $";
+ "$Id: newfs.c,v 1.23 1998/09/11 06:26:08 grog Exp $";
#endif /* not lint */
/*
@@ -247,7 +247,7 @@ main(argc, argv)
opstring = mfs ?
"NF:T:a:b:c:d:e:f:i:m:o:s:" :
- "NOS:T:a:b:c:d:e:f:i:k:l:m:n:o:p:r:s:t:u:v:x";
+ "NOS:T:a:b:c:d:e:f:i:k:l:m:n:o:p:r:s:t:u:vx";
while ((ch = getopt(argc, argv, opstring)) != -1)
switch (ch) {
case 'N':
@@ -454,10 +454,12 @@ main(argc, argv)
if ((st.st_mode & S_IFMT) != S_IFCHR && !mfs)
printf("%s: %s: not a character-special device\n",
progname, special);
- cp = strchr(argv[0], '\0') - 1;
- if (!vflag &&
- cp == (char *)-1 ||
- ((*cp < 'a' || *cp > 'h') && !isdigit(*cp)))
+ cp = strchr(argv[0], '\0');
+ if (cp == argv[0])
+ fatal("null special file name");
+ cp--;
+ if (!vflag && (*cp < 'a' || *cp > 'h') && !isdigit(*cp))
+ ((*cp < 'a' || *cp > 'h') && !isdigit(*cp))))
fatal("%s: can't figure out file system partition",
argv[0]);
#ifdef COMPAT
@@ -757,6 +759,8 @@ usage()
fprintf(stderr, "\t-r revolutions/minute\n");
fprintf(stderr, "\t-t tracks/cylinder\n");
fprintf(stderr, "\t-u sectors/track\n");
+ fprintf(stderr,
+ "\t-v do not attempt to determine partition name from device name\n");
fprintf(stderr, "\t-x spare sectors per cylinder\n");
exit(1);
}