From owner-freebsd-bugs@FreeBSD.ORG Fri Mar 12 02:50:19 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3906616A4CE for ; Fri, 12 Mar 2004 02:50:19 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15C5E43D5C for ; Fri, 12 Mar 2004 02:50:19 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i2CAoIbv040579 for ; Fri, 12 Mar 2004 02:50:18 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i2CAoIvg040578; Fri, 12 Mar 2004 02:50:18 -0800 (PST) (envelope-from gnats) Resent-Date: Fri, 12 Mar 2004 02:50:18 -0800 (PST) Resent-Message-Id: <200403121050.i2CAoIvg040578@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Vasil Dimov Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6580916A4CE for ; Fri, 12 Mar 2004 02:47:25 -0800 (PST) Received: from gw-bj2.datamax.bg (datamax.wl.bitex.com [195.34.115.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6897F43D2D for ; Fri, 12 Mar 2004 02:47:22 -0800 (PST) (envelope-from vd@datamax.bg) Received: from sinanica.lg2a.datamax (sinanica.lg2a.datamax [192.168.10.1]) by gw-bj2.datamax.bg (Postfix) with QMQP id 76FB587CA for ; Fri, 12 Mar 2004 12:47:19 +0200 (EET) Received: (nullmailer pid 12110 invoked by uid 1001); Fri, 12 Mar 2004 10:47:19 -0000 Message-Id: <1079088439.210030.12109.nullmailer@sinanica.lg2a.datamax> Date: Fri, 12 Mar 2004 12:47:19 +0200 From: Vasil Dimov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/64153: mdmfs features via fstab X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Vasil Dimov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2004 10:50:19 -0000 >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@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: