Date: Thu, 15 Dec 2005 02:45:10 GMT From: Lanny Jason Godsey <lannygodsey@yahoo.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/90415: Add -Z (no newfs) to sbin/mount_mfs. Use with existing vnode backed devices between reboots. Message-ID: <200512150245.jBF2jASe006144@www.freebsd.org> Resent-Message-ID: <200512150250.jBF2o6Cv013238@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 90415
>Category: misc
>Synopsis: Add -Z (no newfs) to sbin/mount_mfs. Use with existing vnode backed devices between reboots.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Dec 15 02:50:05 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Lanny Jason Godsey
>Release: RELENG_6_0
>Organization:
>Environment:
FreeBSD ne1.yournix.com 6.0-RELEASE FreeBSD 6.0-RELEASE #6: Mon Dec 5 11:48:50 EST 2005 root@ne1.yournix.com:/usr/obj/usr/src/sys/YOURNIX i386
>Description:
Add -Z (no newfs) to sbin/mount_mfs. Use with existing vnode backed devices between reboots.
ne1# cat /etc/fstab
md /fs mfs rw,noatime,-Z,-F=/home/fs.img 0 0
ne1# df
/dev/md2 495726 6 456062 0% /fs
ne1# mdconfig -l -u md2
md2 vnode 500M /local/fs.img
>How-To-Repeat:
>Fix:
Index: mdmfs.8
===================================================================
RCS file: /usr/ncvs/src/sbin/mdmfs/mdmfs.8,v
retrieving revision 1.20
diff -u -r1.20 mdmfs.8
--- mdmfs.8 17 May 2004 08:35:41 -0000 1.20
+++ mdmfs.8 15 Dec 2005 02:43:26 -0000
@@ -263,6 +263,9 @@
.It Fl X
Print what command will be run before running it, and
other assorted debugging information.
+.It Fl Z
+Skip newfs(8) command. Use with existing vnode backed
+devices between boots.
.El
.Pp
The
Index: mdmfs.c
===================================================================
RCS file: /usr/ncvs/src/sbin/mdmfs/mdmfs.c,v
retrieving revision 1.23
diff -u -r1.23 mdmfs.c
--- mdmfs.c 10 Feb 2005 09:19:30 -0000 1.23
+++ mdmfs.c 15 Dec 2005 02:43:26 -0000
@@ -90,6 +90,7 @@
enum md_types mdtype; /* The type of our memory disk. */
bool have_mdtype;
bool detach, softdep, autounit;
+ bool no_newfs;
char *mtpoint, *unitstr;
char *p;
int ch;
@@ -98,6 +99,7 @@
/* Misc. initialization. */
(void)memset(&mi, '\0', sizeof(mi));
+ no_newfs = false;
detach = true;
softdep = true;
autounit = false;
@@ -121,7 +123,7 @@
compat = true;
while ((ch = getopt(argc, argv,
- "a:b:Cc:Dd:e:F:f:hi:LlMm:Nn:O:o:p:Ss:t:Uv:w:X")) != -1)
+ "a:b:Cc:Dd:e:F:f:hi:LlMm:Nn:O:o:p:Ss:t:Uv:w:XZ")) != -1)
switch (ch) {
case 'a':
argappend(&newfs_arg, "-a %s", optarg);
@@ -228,6 +230,9 @@
usage();
debug = true;
break;
+ case 'Z':
+ no_newfs = true;
+ break;
default:
usage();
}
@@ -271,7 +276,8 @@
do_mdconfig_attach_au(mdconfig_arg, mdtype);
else
do_mdconfig_attach(mdconfig_arg, mdtype);
- do_newfs(newfs_arg);
+ if (!no_newfs)
+ do_newfs(newfs_arg);
do_mount(mount_arg, mtpoint);
do_mtptsetup(mtpoint, &mi);
@@ -670,13 +676,13 @@
name = "mdmfs";
if (!compat)
fprintf(stderr,
-"usage: %s [-DLlMNSUX] [-a maxcontig] [-b block-size] [-c cylinders]\n"
+"usage: %s [-DLlMNSUXZ] [-a maxcontig] [-b block-size] [-c cylinders]\n"
"\t[-d rotdelay] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]\n"
"\t[-m percent-free] [-n rotational-positions] [-O optimization]\n"
"\t[-o mount-options] [-p permissions] [-s size] [-v version]\n"
"\t[-w user:group] md-device mount-point\n", name);
fprintf(stderr,
-"usage: %s -C [-lNU] [-a maxcontig] [-b block-size] [-c cylinders]\n"
+"usage: %s -C [-lNUZ] [-a maxcontig] [-b block-size] [-c cylinders]\n"
"\t[-d rotdelay] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]\n"
"\t[-m percent-free] [-n rotational-positions] [-O optimization]\n"
"\t[-o mount-options] [-s size] [-v version] md-device mount-point\n", name);
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512150245.jBF2jASe006144>
