Currently, mdmfs will allways do a newfs before mounting a mfs. When using filesystem image files (MD_VNODE), an option to skip the newfs part, preserving the existing filesystem would be desirable. Fix: Add a -P option to mdmfs (and mount_mfs) that will skip the do_newfs() part. Adding P to the fstab line above like this: /dev/md1 /jails/jail1 mfs rw,-PF/jails/vnodes/jail1fs,async 0 0 will preserve data between mounts. The following patch adds the -P option (patch for HEAD) : How-To-Repeat: root@caliban:/root> tail -1 /etc/fstab /dev/md1 /jails/jail1 mfs rw,-F/jails/vnodes/jail1fs,async 0 0 root@caliban:/root> mount /jails/jail1 root@caliban:/root> touch /jails/jail1/IMPORTANT_DATA root@caliban:/root> umount /jails/jail1 root@caliban:/root> mount /jails/jail1 root@caliban:/root> ls /jails/jail1 root@caliban:/root>
On Mon, Oct 06, 2003 at 10:46:58AM +0200, Ruben de Groot wrote: > > >Number: 57641 > >Category: bin > >Synopsis: [patch] missing option in mdmfs (mount_mfs) > >Originator: Ruben de Groot > >Release: FreeBSD 5.1-CURRENT i386 [snip] > >Description: > > Currently, mdmfs will allways do a newfs before mounting a mfs. > When using filesystem image files (MD_VNODE), an option to skip > the newfs part, preserving the existing filesystem would be > desirable. [snip] > >Fix: > > Add a -P option to mdmfs (and mount_mfs) that will skip the > do_newfs() part. Adding P to the fstab line above like this: [snip] > 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 [snip] > @@ -195,6 +195,11 @@ > 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 > +.Pq Dv MD_VNODE . > .It Fl p Ar permissions > Set the file (directory) permissions of the mount point > .Ar mount-point Just a minor mdoc comment on this part: generally we put new sentences on separate lines :) Also, what do you think about this wording change: @@ -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 G'luck, Peter -- Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 What would this sentence be like if it weren't self-referential?
On Mon, Oct 06, 2003 at 12:38:25PM +0300, Peter Pentchev typed: > > Just a minor mdoc comment on this part: generally we put new sentences > on separate lines :) Also, what do you think about this wording change: > > @@ -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 This looks better. Thanks for pointing that out. I'm no mdoc expert (yet) Ruben -- "We don't care. We don't have to. We're the Phone Company."
Responsible Changed From-To: freebsd-bugs->dd Looks mostly reasonable. I'll fix up the patch and commit it later this week.
State Changed From-To: open->closed Committed to -current, thanks! (And sorry for taking so long.)