bin/64153: mdmfs features via fstab

Vasil Dimov vd at datamax.bg
Fri Mar 12 02:50:19 PST 2004


>Number:         64153
>Category:       bin
>Synopsis:       mdmfs features via fstab
>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:   Fri Mar 12 02:50:18 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Vasil Dimov
>Release:        FreeBSD 5.2.1-RELEASE-p1 i386
>Organization:
DataMax
>Environment:
System: FreeBSD sinanica.lg2a.datamax 5.2.1-RELEASE-p1 FreeBSD 5.2.1-RELEASE-p1 #5: Thu Mar 11 13:16:46 EET 2004 root at sinanica.lg2a.datamax:/usr/src/sys/i386/compile/SINANICA-SMP i386
>Description:
We don't have mount_XXX interface to mdmfs(8), so it's
features cannot be used in fstab.
>How-To-Repeat:
We want the following line in /etc/fstab to create a malloc disk of size 32m
and mount it to /mnt:

md	/mnt	mfs	rw,-M,-s32m,-Otime,-p1777	1	0

but it calls mount_mfs which does not know about -M.
mount_FSTYPE is always searched and we can't call mdmfs.
>Fix:
some workaround can be to
ln -s /sbin/mdmfs /sbin/mount_foo
and use filesystem type foo in fstab.
But what a stupid link must be laying in /sbin/ and what a new filesystem
name to think of?

It would be better to make mount_mfs operate like mdmfs as they
are one program anyway.

mdmfs can be called with -C to operate like the old mount_mfs (compatible mode)
so I add -I (incompatible mode) to negate `-C' or `getprogname() = mount_mfs'
meaning. What we get is `mount_mfs -I' working like mdmfs. So in fstab:

md	/mnt	mfs	rw,-I,-M,-s32m,-Otime,-p1777	1	0

The following is a simple "patch":

***** BEGIN mdmfs.c.-I.patch *****
--- mdmfs.c.orig	Fri Mar 12 11:30:57 2004
+++ mdmfs.c	Fri Mar 12 11:30:47 2004
@@ -118,7 +118,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:hIi:LMm:Nn:O:o:p:Ss:t:Uv:w:X")) != -1)
 		switch (ch) {
 		case 'a':
 			argappend(&newfs_arg, "-a %s", optarg);
@@ -157,6 +157,9 @@
 			break;
 		case 'h':
 			usage();
+			break;
+		case 'I':
+			compat = false;
 			break;
 		case 'i':
 			argappend(&newfs_arg, "-i %s", optarg);
***** END mdmfs.c.-I.patch *****

and the manual page of course:

***** BEGIN mdmfs.8.-I.patch *****
--- mdmfs.8.orig	Fri Mar 12 12:06:26 2004
+++ mdmfs.8	Fri Mar 12 12:06:16 2004
@@ -160,6 +160,13 @@
 .Ar file .
 .It Fl f Ar frag-size
 The fragment size of the file system in bytes.
+.It Fl I
+Incompatible (with mount_mfs(8)) mode. This is the default.
+It can be used to exert the
+.Nm
+power via mount_mfs command or to negate the
+.Fl C
+flag, should such a need occur.
 .It Fl i Ar bytes
 Number of bytes per inode.
 .It Fl L
***** END mdmfs.8.-I.patch *****

Cheerz!
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list