Re: Accesses to not yet running array
From: Francis Moreau <hidden>
Date: 2013-08-27 08:11:03
Hello Martin, On Sat, Aug 24, 2013 at 8:41 PM, Martin Wilck [off-list ref] wrote:
On 08/24/2013 02:42 PM, Francis Moreau wrote:quoted
On Sat, Aug 24, 2013 at 2:40 PM, Francis Moreau [off-list ref] wrote:quoted
Hello Martin, On Fri, Aug 23, 2013 at 9:09 PM, Martin Wilck [off-list ref] wrote:quoted
On 08/23/2013 12:00 PM, Francis Moreau wrote:quoted
[ adding Martin in CC since it seems related to DDF... ]I reproduced it here. The problem is that mdmon isn't running. Simply try running "mdmon /dev/md127", and the mount should proceed.oh, ok, I should have noticed.quoted
You'd avoid the problem by running "mdadm -IR /dev/sda" in the first place.Actually this is how arrays are assembled during boot on some distributions (Fedora for example).I meant the sequence: mdadm -I /dev/sda mdadm -I /dev/sdb mdadm -R /dev/mdxxx is used by distribution.CentOS 6 uses the following sequence: mdadm -I /dev/sda mdadm -I /dev/sdb mdadm -I /dev/mdXXX I don't see mdadm -R anywhere on CentOS.
After digging into the code of dracut, it seems that the bug (mdmon
not started by mdadm -R /dev/mdxxx on incomplete array) seems to be
known and a workaround exists.
Basically the script which starts MD arrays (slightly modified by me
to make it easier to read) does:
for md in /dev/md[0-9_]*; do
...
[ $(cat $md/array_state) != inactive ] && continue
mdadm --offroot -R $md
[ $(cat $md/array_state) = inactive ] && continue
# workaround for mdmon bug
[ $(cat $md/degraded) -gt 0 ] && mdmon --offroot --takeover $md
done
In theory this should fix the bug but it doesn't (looks like I'm
really unlucky). Indeed at the time the script is run, the container
device doesn't exist in /dev. Therefore the workaround is only
executed on the MD array device. I can see the following message
during the boot: "mdmon: md126 is not a container - cannot monitor"
I tried to add "udevadm settle" before executing the workaround but
that doesn't help.
You could change your udev rules to run "mdadm -IR /dev/mdXXX" instead. Have you tried that?
I tried and it works fine. Thanks -- Francis