From: Luca Berra <bluca@comedia.it>
To: Linux RAID Mailing List <linux-raid@vger.kernel.org>
Cc: Neil Brown <neilb@suse.de>
Subject: [PATCH] enable auto=yes by default when using udev
Date: Mon, 3 Jul 2006 00:45:50 +0200 [thread overview]
Message-ID: <20060702224549.GD12733@percy.comedia.it> (raw)
[-- 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);
}
next reply other threads:[~2006-07-02 22:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-02 22:45 Luca Berra [this message]
2006-07-02 23:14 ` [PATCH] enable auto=yes by default when using udev 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060702224549.GD12733@percy.comedia.it \
--to=bluca@comedia.it \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).