linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] enable auto=yes by default when using udev
@ 2006-07-02 22:45 Luca Berra
  2006-07-02 23:14 ` Neil Brown
  0 siblings, 1 reply; 14+ messages in thread
From: Luca Berra @ 2006-07-02 22:45 UTC (permalink / raw)
  To: Linux RAID Mailing List; +Cc: Neil Brown

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

Hello,
the following patch aims at solving an issue that is confusing a lot of
users.
when using udev, device files are created only when devices are
registered with the kernel, and md devices are registered only when
started.
mdadm needs the device file _before_ starting the array.
so when using udev you must add --auto=yes to the mdadm commandline or
to the ARRAY line in mdadm.conf

following patch makes auto=yes the default when using udev

L.


-- 
Luca Berra -- bluca@comedia.it
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \

[-- Attachment #2: mdadm-2.5.1-autof.patch --]
[-- Type: text/plain, Size: 896 bytes --]

* Sat Jun 24 2006 Luca Berra <bluca@vodka.it>
- automatically create devices if using udev

--- mdadm-2.5.1/mdadm.c.autof	2006-06-02 01:51:01.000000000 -0400
+++ mdadm-2.5.1/mdadm.c	2006-06-24 05:17:45.000000000 -0400
@@ -857,6 +857,13 @@
 		fputs(Usage, stderr);
 		exit(2);
 	}
+
+	/* if we are using udev and auto is not set, mdadm will almost
+	 * certainly fail, so we force it here.
+	 */
+	if (autof == 0 && access("/dev/.udevdb",F_OK) == 0)
+		autof=2;
+
 	/* Ok, got the option parsing out of the way
 	 * hopefully it's mostly right but there might be some stuff
 	 * missing
@@ -873,7 +880,7 @@
 			fprintf(stderr, Name ": an md device must be given in this mode\n");
 			exit(2);
 		}
-		if ((int)ident.super_minor == -2 && autof) {
+		if ((int)ident.super_minor == -2 && autof > 2 ) {
 			fprintf(stderr, Name ": --super-minor=dev is incompatible with --auto\n");	
 			exit(2);
 		}

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-07-18 10:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-02 22:45 [PATCH] enable auto=yes by default when using udev Luca Berra
2006-07-02 23:14 ` Neil Brown
2006-07-02 23:29   ` Jason Lunz
2006-07-03  9:11     ` Mario 'BitKoenig' Holbe
2006-07-03 10:56   ` David Greaves
2006-07-03 11:13   ` Frank Blendinger
2006-07-03 22:46   ` Luca Berra
2006-07-04 10:43     ` Luca Berra
2006-07-04 10:29   ` Michael Tokarev
2006-07-04 10:47     ` Luca Berra
2006-07-04 12:19     ` Mario 'BitKoenig' Holbe
2006-07-18  5:19       ` Neil Brown
2006-07-18 10:07         ` Christian Pernegger
2006-07-17 19:42     ` Bill Davidsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).