Re: [Patch] mdmfs currently broken

2003-09-05 Thread Bruce Evans
On Thu, 4 Sep 2003, Poul-Henning Kamp wrote:

 In message [EMAIL PROTECTED], Stefan =?iso-8859-
 1?Q?E=DFer?= writes:
 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 ?

 Yes, please don't.

 We should not revert to putting BSD labels on everything.

 I'll find the root cause and fix that instead, it's probably
 fall-out from my ioctl change.

Disk labels are required by the not unused fsck_ffs utility to search
for alternate superblocks.

Bruce
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: [Patch] mdmfs currently broken

2003-09-05 Thread Poul-Henning Kamp
In message [EMAIL PROTECTED], Bruce Evans writes:

 We should not revert to putting BSD labels on everything.

Disk labels are required by the not unused fsck_ffs utility to search
for alternate superblocks.

You mean:

The widely used fsck_ffs utility is able to use information from
the optional BSD disklabel.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: [Patch] mdmfs currently broken

2003-09-05 Thread Bruce Evans
On Fri, 5 Sep 2003, Poul-Henning Kamp wrote:

 In message [EMAIL PROTECTED], Bruce Evans writes:

  We should not revert to putting BSD labels on everything.
 
 Disk labels are required by the not unused fsck_ffs utility to search
 for alternate superblocks.

 You mean:

 The widely used fsck_ffs utility is able to use information from
 the optional BSD disklabel.

I mean:

The widely used fsck_ffs utility's ability to find alternate superblocks
will be broken when it is most needed if certain parts of disk labels or
equivalent metadata is not written automatically somewhere outside of
the file system proper.  Users who don't know what a disk label or an
alternate superblock is can't be expected to back them up or calculate
the correct block number to supply to fsck_ffs -b.  The file system info
in the label is a form of backup of a (very) few parameters.  The
alternate superblocks are another.

Bruce
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


[Patch] mdmfs currently broken

2003-09-04 Thread Stefan E├čer
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 -  1.24
+++ include/paths.h 4 Sep 2003 18:12:27 -
@@ -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 -   1.17
+++ sbin/mdmfs/mdmfs.c  4 Sep 2003 18:09:02 -
@@ -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]


Re: [Patch] mdmfs currently broken

2003-09-04 Thread Poul-Henning Kamp
In message [EMAIL PROTECTED], Stefan =?iso-8859-
1?Q?E=DFer?= writes:
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 ?

Yes, please don't.

We should not revert to putting BSD labels on everything.

I'll find the root cause and fix that instead, it's probably
fall-out from my ioctl change.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]