From owner-freebsd-current@FreeBSD.ORG Thu Sep 4 11:29:01 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 077B116A4BF; Thu, 4 Sep 2003 11:29:01 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.184]) by mx1.FreeBSD.org (Postfix) with ESMTP id A260F43FEA; Thu, 4 Sep 2003 11:28:59 -0700 (PDT) (envelope-from se@freebsd.org) Received: from [212.227.126.206] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 19uyqp-0002zZ-00; Thu, 04 Sep 2003 20:28:59 +0200 Received: from [80.132.231.70] (helo=Gatekeeper.FreeBSD.org) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 19uyqo-00078T-00; Thu, 04 Sep 2003 20:28:58 +0200 Received: from StefanEsser.FreeBSD.org (StefanEsser [10.0.0.1]) by Gatekeeper.FreeBSD.org (Postfix) with ESMTP id D46A75F18; Thu, 4 Sep 2003 20:28:56 +0200 (CEST) Received: by StefanEsser.FreeBSD.org (Postfix, from userid 200) id 732411E47; Thu, 4 Sep 2003 20:28:56 +0200 (CEST) Date: Thu, 4 Sep 2003 20:28:56 +0200 From: Stefan =?iso-8859-1?Q?E=DFer?= To: freebsd-current@freebsd.org Message-ID: <20030904182856.GA15220@StefanEsser.FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i Subject: [Patch] mdmfs currently broken X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2003 18:29:01 -0000 Seems that mdmfs stopped working recently (probably because of GEOM related changes). One possible fix is to label the md and newfs the thusly created c partition. This requires running /sbin/disklabel, which didn't have an entry in paths.h. Any objections against me committing the follwoing fixes to -current ? Should md0c be used as a parameter to mdmfs instead of md0 (and should it be printed in df and mount output) ??? Regards, STefan Index: include/paths.h =================================================================== RCS file: /usr/cvs/src/include/paths.h,v retrieving revision 1.24 diff -u -3 -r1.24 paths.h --- include/paths.h 29 Jun 2003 18:35:36 -0000 1.24 +++ include/paths.h 4 Sep 2003 18:12:27 -0000 @@ -58,6 +58,7 @@ #define _PATH_DEFTAPE "/dev/sa0" #define _PATH_DEVNULL "/dev/null" #define _PATH_DEVZERO "/dev/zero" +#define _PATH_DISKLABEL "/sbin/disklabel" #define _PATH_DRUM "/dev/drum" #define _PATH_ETC "/etc" #define _PATH_FTPUSERS "/etc/ftpusers" @@ -113,6 +114,8 @@ #define _PATH_CP "/rescue/cp" #undef _PATH_CSHELL #define _PATH_CSHELL "/rescue/csh" +#undef _PATH_DISKLABEL +#define _PATH_DISKLABEL "/rescue/disklabel" #undef _PATH_HALT #define _PATH_HALT "/rescue/halt" #undef _PATH_IFCONFIG Index: sbin/mdmfs/mdmfs.c =================================================================== RCS file: /usr/cvs/src/sbin/mdmfs/mdmfs.c,v retrieving revision 1.17 diff -u -3 -r1.17 mdmfs.c --- sbin/mdmfs/mdmfs.c 5 Aug 2003 15:04:39 -0000 1.17 +++ sbin/mdmfs/mdmfs.c 4 Sep 2003 18:09:02 -0000 @@ -77,6 +77,7 @@ static void do_mount(const char *, const char *); static void do_mtptsetup(const char *, struct mtpt_info *); static void do_newfs(const char *); +static void do_disklabel(void); static void extract_ugid(const char *, struct mtpt_info *); static int run(int *, const char *, ...) __printflike(2, 3); static void usage(void); @@ -264,6 +265,7 @@ do_mdconfig_attach_au(mdconfig_arg, mdtype); else do_mdconfig_attach(mdconfig_arg, mdtype); + do_disklabel(); do_newfs(newfs_arg); do_mount(mount_arg, mtpoint); do_mtptsetup(mtpoint, &mi); @@ -467,6 +469,19 @@ } /* + * Write simple disklabel + */ +static void +do_disklabel(void) +{ + int rv; + + rv = run(NULL, "%s -w /dev/%s%d auto", _PATH_DISKLABEL, mdname, unit); + if (rv) + errx(1, "disklabel exited with error code %d", rv); +} + +/* * Put a file system on the memory disk. */ static void @@ -474,7 +489,7 @@ { int rv; - rv = run(NULL, "%s%s /dev/%s%d", _PATH_NEWFS, args, mdname, unit); + rv = run(NULL, "%s%s /dev/%s%dc", _PATH_NEWFS, args, mdname, unit); if (rv) errx(1, "newfs exited with error code %d", rv); }