summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>1998-09-11 06:26:08 +0000
committergrog <grog@FreeBSD.org>1998-09-11 06:26:08 +0000
commit5397190b7e68d4b77564021e5001432251758567 (patch)
tree330eb490e8cd9da7df3b9cc50e6b1ba8cff49d07 /sbin/newfs
parent484b9ba5881ec721979dd06376c6f1a7e42e744b (diff)
downloadFreeBSD-src-5397190b7e68d4b77564021e5001432251758567.zip
FreeBSD-src-5397190b7e68d4b77564021e5001432251758567.tar.gz
Reviewed by: bde,jkh
Add -v flag to newfs: -v Specify that the partition does not contain any slices, and that newfs should treat the whole partition as the file system. This option is useful for synthetic disks such as ccd and vinum.
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/newfs.814
-rw-r--r--sbin/newfs/newfs.c15
2 files changed, 22 insertions, 7 deletions
diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8
index 147db97..f93bfdd 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$
+.\" $Id: newfs.8,v 1.15 1998/07/15 06:28:04 charnier Exp $
.\"
.Dd May 3, 1995
.Dt NEWFS 8
@@ -61,6 +61,7 @@
.Op Fl s Ar size
.Op Fl t Ar tracks
.Op Fl u Ar sectors
+.Op Fl v
.Op Fl x Ar sectors
.Ar special
.Nm mount_mfs
@@ -212,6 +213,14 @@ See
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 partition does not contain any slices, and that
+.Nm
+should treat the whole partition as the file system. This option is useful for
+synthetic disks such as
+.Nm ccd
+and
+.Nm vinum.
.El
.Pp
The following options override the standard sizes for the disk geometry.
@@ -314,7 +323,8 @@ not be able to boot from a file system that uses another size.
.Xr fsck 8 ,
.Xr mount 8 ,
.Xr scsiformat 8 ,
-.Xr tunefs 8
+.Xr tunefs 8 ,
+.Xr vinum 8
.Rs
.%A M. McKusick
.%A W. Joy
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index d2ba9ac..580067e 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.21 1998/07/16 12:04:52 charnier Exp $";
+ "$Id: newfs.c,v 1.22 1998/07/20 12:04:42 bde Exp $";
#endif /* not lint */
/*
@@ -226,7 +226,7 @@ main(argc, argv)
struct partition oldpartition;
struct stat st;
struct statfs *mp;
- int fsi, fso, len, n;
+ int fsi, fso, len, n, vflag;
char *cp, *s1, *s2, *special, *opstring;
#ifdef MFS
struct vfsconf vfc;
@@ -234,6 +234,7 @@ main(argc, argv)
char buf[BUFSIZ];
#endif
+ vflag = 0;
if ((progname = strrchr(*argv, '/')))
++progname;
else
@@ -246,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:x:";
+ "NOS:T:a:b:c:d:e:f:i:k:l:m:n:o:p:r:s:t:u:v:x";
while ((ch = getopt(argc, argv, opstring)) != -1)
switch (ch) {
case 'N':
@@ -352,6 +353,9 @@ main(argc, argv)
if ((nsectors = atoi(optarg)) < 0)
fatal("%s: bad sectors/track", optarg);
break;
+ case 'v':
+ vflag = 1;
+ break;
case 'x':
if ((cylspares = atoi(optarg)) < 0)
fatal("%s: bad spare sectors per cylinder",
@@ -451,7 +455,8 @@ main(argc, argv)
printf("%s: %s: not a character-special device\n",
progname, special);
cp = strchr(argv[0], '\0') - 1;
- if (cp == (char *)-1 ||
+ if (!vflag &&
+ cp == (char *)-1 ||
((*cp < 'a' || *cp > 'h') && !isdigit(*cp)))
fatal("%s: can't figure out file system partition",
argv[0]);
@@ -460,7 +465,7 @@ main(argc, argv)
disktype = argv[1];
#endif
lp = getdisklabel(special, fsi);
- if (isdigit(*cp))
+ if (vflag || isdigit(*cp))
pp = &lp->d_partitions[0];
else
pp = &lp->d_partitions[*cp - 'a'];
OpenPOWER on IntegriCloud