Common subdirectories: sbin/mdmfs.orig/CVS and sbin/mdmfs/CVS diff -u sbin/mdmfs.orig/mdmfs.8 sbin/mdmfs/mdmfs.8 --- sbin/mdmfs.orig/mdmfs.8 Wed Aug 6 04:41:52 2003 +++ sbin/mdmfs/mdmfs.8 Mon Oct 6 08:48:27 2003 @@ -36,7 +36,7 @@ driver .Sh SYNOPSIS .Nm -.Op Fl DLMNSUX +.Op Fl DLMNPSUX .Op Fl a Ar maxcontig .Op Fl b Ar block-size .Op Fl c Ar cylinders @@ -57,7 +57,7 @@ .Ar mount-point .Nm .Fl C -.Op Fl NU +.Op Fl NPU .Op Fl a Ar maxcontig .Op Fl b Ar block-size .Op Fl c Ar cylinders @@ -195,6 +195,12 @@ See .Xr mount 8 for more information. +.It Fl P +Preserve existing filesystem - do not run newfs. +This only makes sense if +.Fl F +is specified to create a vnode-backed disk +.Pq Dv MD_VNODE . .It Fl p Ar permissions Set the file (directory) permissions of the mount point .Ar mount-point diff -u sbin/mdmfs.orig/mdmfs.c sbin/mdmfs/mdmfs.c --- sbin/mdmfs.orig/mdmfs.c Fri Oct 3 13:50:18 2003 +++ sbin/mdmfs/mdmfs.c Sat Oct 4 13:41:14 2003 @@ -89,7 +89,7 @@ *mount_arg; enum md_types mdtype; /* The type of our memory disk. */ bool have_mdtype; - bool detach, softdep, autounit; + bool detach, softdep, autounit, no_newfs; char *mtpoint, *unitstr; char ch, *p; void *set; @@ -99,6 +99,7 @@ detach = true; softdep = true; autounit = false; + no_newfs = false; have_mdtype = false; mdname = MD_NAME; mdnamelen = strlen(mdname); @@ -118,7 +119,7 @@ compat = true; while ((ch = getopt(argc, argv, - "a:b:Cc:Dd:e:F:f:hi:LMm:Nn:O:o:p:Ss:t:Uv:w:X")) != -1) + "a:b:Cc:Dd:e:F:f:hi:LMm:Nn:O:o:Pp:Ss:t:Uv:w:X")) != -1) switch (ch) { case 'a': argappend(&newfs_arg, "-a %s", optarg); @@ -189,6 +190,9 @@ case 'o': argappend(&mount_arg, "-o %s", optarg); break; + case 'P': + no_newfs = true; + break; case 'p': if (compat) usage(); @@ -264,7 +268,8 @@ do_mdconfig_attach_au(mdconfig_arg, mdtype); else do_mdconfig_attach(mdconfig_arg, mdtype); - do_newfs(newfs_arg); + if (!no_newfs || (mdtype != MD_VNODE)) + do_newfs(newfs_arg); do_mount(mount_arg, mtpoint); do_mtptsetup(mtpoint, &mi); @@ -661,13 +666,13 @@ name = "mdmfs"; if (!compat) fprintf(stderr, -"usage: %s [-DLMNSUX] [-a maxcontig [-b block-size] [-c cylinders]\n" +"usage: %s [-DLMNPSUX] [-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] [-w user:group]\n" "\tmd-device mount-point\n", name); fprintf(stderr, -"usage: %s -C [-NU] [-a maxcontig] [-b block-size] [-c cylinders]\n" +"usage: %s -C [-NPU] [-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] md-device mount-point\n", name);