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);
 }
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to