Gentoo Archives: gentoo-user

From: Peter Humphrey <peter@××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Software RAID-1
Date: Mon, 25 Aug 2014 16:51:54
Message-Id: 5380631.7N40di66pN@wstn
In Reply to: Re: [gentoo-user] Software RAID-1 by Kerin Millar
1 On Monday 25 August 2014 13:35:11 Kerin Millar wrote:
2 > On 25/08/2014 12:17, Peter Humphrey wrote:
3 >
4 > <snip>
5 >
6 > > Well, it was simple. I just said "rc-update del mdraid boot" and all is
7 > > now
8 > > well. I'd better revisit the docs to see if they still give the same
9 > > advice.
10 >
11 > Very interesting indeed.
12
13 You wrote this e-mail after the other two, so I'll stick to this route,
14 leaving the other idea for later if needed.
15
16 > I now wonder if this is a race condition between the init script running
17 > `mdadm -As` and the fact that the mdadm package installs udev rules that
18 > allow for automatic incremental assembly?
19
20 Isn't it just that, with the kernel auto-assembly of the root partition, and
21 udev rules having assembled the rest, all the work's been done by the time the
22 mdraid init script is called? I had wondered about the time that udev startup
23 takes; assembling the raids would account for it.
24
25 > Refer to /lib/udev/rules.d/64-md-raid.rules and you'll see that it calls
26 > `mdadm --incremental` for newly added devices.
27
28 # ls -l /lib/udev/rules.d | grep raid
29 -rw-r--r-- 1 root root 2.1K Aug 23 10:34 63-md-raid-arrays.rules
30 -rw-r--r-- 1 root root 1.4K Aug 23 10:34 64-md-raid-assembly.rules
31
32 > With that in mind, here's something else for you to try. Doing this will
33 > render these udev rules null and void:
34 >
35 > # touch /etc/udev/rules.d/64-md-raid.rules
36
37 I did that, but I think I need instead to
38 # touch /etc/udev/rules.d/63-md-raid-arrays.rules
39 # touch /etc/udev/rules.d/64-md-raid-assembly.rules
40
41 I'll try it now...
42
43 > Thereafter, the mdraid script will be the only agent trying to assemble
44 > the 1.x metadata arrays so make sure that it is re-enabled.
45
46 Right. Here's the position:
47 1. I've left /etc/init.d/mdraid out of all run levels. I have nothing but
48 comments in mdadm.conf, but then it's not likely to be read anyway if the
49 init script isn't running.
50 2. I have empty /etc/udev rules files as above.
51 3. I have kernel auto-assembly of raid enabled.
52 4. I don't use an init ram disk.
53 5. The root partition is on /dev/md5 (0.99 metadata)
54 6. All other partitions except /boot are under /dev/vg7 which is built on
55 top of /dev/md7 (1.x metadata).
56 7. The system boots normally.
57
58 > I'm not actually sure that there is any point in calling mdadm -As where
59 > the udev rules are present. I would expect it to be one approach or the
60 > other, but not both at the same time.
61
62 That makes sense to me too. Do I even need sys-fs/mdadm installed? Maybe I'll
63 try removing it. I have a little rescue system in the same box, so it'd be
64 easy to put it back if necessary.
65
66 > Incidentally, the udev rules were a source of controversy in the
67 > following bug. Not everyone appreciates that they are installed by default.
68 >
69 > https://bugs.gentoo.org/show_bug.cgi?id=401707
70
71 I'll have a look at that - thanks.
72
73 --
74 Regards
75 Peter

Replies

Subject Author
Re: [gentoo-user] Software RAID-1 Kerin Millar <kerframil@×××××××××××.uk>