Bug#830770: mdadm: initramfs broken

Jamie Heilman jamie at audible.transient.net
Sun Jul 17 04:48:50 UTC 2016


Jamie Heilman wrote:
> I wouldn't be stunned if this problem mostly stemmed from the fact
> that /scripts/init-top/udev executes prior to loading kernel modules.
> It might be interesting to see what happens if we toss
>  udevadm trigger --action=add
>  udevadm settle || true
> into a script in /scripts/init-premount ... 

So, I tried that, it works; though I'm not entirely happy with the
solution, it seems rather brutish.  The init-premount/mdadm script I
used was:

#!/bin/sh

PREREQS="udev"

prereqs() { echo "$PREREQS"; }

case "$1" in
    prereqs) prereqs; exit 0 ;;
esac

udevadm trigger --action=add -s block
udevadm settle || true

exit 0

What strikes me as annoying about this though, is that the only real
change between scripts/init-top/udev running and init-premount/mdadm
running, is the load_modules call.  I noticed that when I ran modprobe
md_mod manually, then ran udevadm trigger --action=add -s block, udev
would automatically assemble the array without further complaint, so I
figured if I just added:
TEST!="[module/md_mod]", RUN{builtin}+="kmod load md_mod"
after the md_inc label in 64-md-raid-assembly.rules that I might not
need the init-premount/mdadm script at all, and that the array would
be assembled automaticaly when init-top/udev ran.  So, I tried that
too, but it doesn't work for reasons that I haven't figured out yet,
maybe due to race conditions or something.

If udev can't be used to automatically construct the array, maybe
calling mdadm --assemble --scan in an init-premount script really is
the better appraoch.  Replying all the block device add events seems
like it could have unwanted side-effects.

Anyway, so there are workarounds, but what the Right Way to fix this
is, I'm not sure about.  Attached patch takes care of the
aforementioned case sensitivity regression.

-- 
Jamie Heilman                     http://audible.transient.net/~jamie/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hooks-mdadm-case-sensitivity-fix.patch
Type: text/x-diff
Size: 888 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mdadm-devel/attachments/20160717/cf388676/attachment.patch>


More information about the pkg-mdadm-devel mailing list