Bug 57641 - [patch] missing option in mount_mfs(8)
Summary: [patch] missing option in mount_mfs(8)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 5.1-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: dd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-06 09:50 UTC by Ruben de Groot
Modified: 2006-01-02 01:53 UTC (History)
0 users

See Also:


Attachments
file.diff (2.77 KB, patch)
2003-10-06 09:50 UTC, Ruben de Groot
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ruben de Groot 2003-10-06 09:50:22 UTC
	
	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>
Comment 1 Peter Pentchev 2003-10-06 10:38:25 UTC
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?
Comment 2 Ruben de Groot 2003-10-06 12:15:29 UTC
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."
Comment 3 dd freebsd_committer 2004-11-30 14:40:14 UTC
Responsible Changed
From-To: freebsd-bugs->dd

Looks mostly reasonable. I'll fix up the patch and commit it later this week.
Comment 4 dd freebsd_committer 2006-01-02 01:52:49 UTC
State Changed
From-To: open->closed

Committed to -current, thanks! (And sorry for taking so long.)