Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 221696 - mkinitrd "forgets" raid modules
mkinitrd "forgets" raid modules
Product: Fedora
Classification: Fedora
Component: mkinitrd (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Jones
Will Woods
: Reopened
Depends On: 213586
Blocks: FC7Blocker
  Show dependency treegraph
Reported: 2007-01-06 05:05 EST by Nicolas Mailhot
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-21 13:41:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Crash (483.20 KB, image/jpeg)
2007-05-16 04:58 EDT, Nicolas Mailhot
no flags Details

  None (edit)
Description Nicolas Mailhot 2007-01-06 05:05:46 EST
Description of problem:

I have a lvm-over-md-raid-1 system

Somehow all recently installed kernels (rawhide-provided or home-compiled) do
not boot.

Upon investigation, it seems the new mkinird "forgets" to include the raid1
module in initrd files, even though it is in use in the live system
Comment 1 Nicolas Mailhot 2007-01-06 10:06:56 EST
Looking at it a bit more, the test for md devices is wrong. It should look like:

 if [[ "$device" =~ ^md[0-9]+$ ]]; then
            vecho "Found RAID component $device"

(note no "" around the second term so bash recognizes it as a regexp and does
not return 2)
Comment 2 Nicolas Mailhot 2007-01-06 10:08:51 EST
(tested with the patch in bug #213586 & the resulting initrd worked)

Comment 3 Clyde E. Kunkel 2007-01-11 00:10:54 EST
#2 not clear to me...if it is saying that the patch resulted in
mkinitrd-6.0.6-1, then it does not work.  My software raid device is detected as
such, but the raidautorun command is not included in init, nor are the raid modules.
Comment 4 Nicolas Mailhot 2007-01-11 03:00:12 EST
You need
1. to change the expression detecting raid devices (as in comment #1) or initrd
won't include raid modules
2. (maybe, didn't test without it) do the change documented in bug #213586 to
get mdadm in the initrd

The result is something like this:
--- /sbin/mkinitrd      2006-12-19 22:54:08.000000000 +0100
+++ /tmp/mkinitrd       2007-01-11 08:57:57.000000000 +0100
@@ -438,7 +438,7 @@
                 continue ;;
             *) handleddevices="$handleddevices $device" ;;
-        if [[ "$device" =~ "md[0-9]+" ]]; then
+        if [[ "$device" =~ ^md[0-9]+$ ]]; then
             vecho "Found RAID component $device"
             handleraid "$device"
@@ -1222,6 +1222,13 @@
     mknod $MNTIMAGE/dev/efirtc c 10 136
+if [ -n "$raiddevices" ] ; then
+    inst /sbin/mdadm.static "$MNTIMAGE" /bin/mdadm
+    if [ -f /etc/mdadm.conf ]; then
+        cp $verbose --parents /etc/mdadm.conf $MNTIMAGE/
+    fi
 # FIXME -- this can really go poorly with clvm or duplicate vg names.
 # nash should do lvm probing for us and write its own configs.
 if [ -n "$vg_list" ]; then
@@ -1364,8 +1371,7 @@
 if [ -n "$raiddevices" ]; then
     for dev in $raiddevices; do
-        cp -a /dev/${dev} $MNTIMAGE/dev
-        emit "raidautorun /dev/${dev}"
+        emit "mdadm -As --auto=yes /dev/${dev}"

Comment 5 Nicolas Mailhot 2007-01-11 07:15:57 EST
(In reply to comment #3)
> #2 not clear to me...if it is saying that the patch resulted in
> mkinitrd-6.0.6-1, then it does not work. 

Nah, it's saying mkinitrd-6.0.6-1 needs the patch to work
Comment 6 Chun-Chung Chen 2007-01-12 20:46:18 EST
Actually, all the double quotes ("") following =~ should be removed for mkinitrd
to work correctly with bash-3.2
See new feature f. for bash-3.2 in /usr/share/doc/bash-3.2/NEWS
Comment 7 Nicolas Mailhot 2007-01-21 06:52:11 EST
mkinitrd-6.0.6-2.x86_64 includes the double quotes changes but not the bug
#213586 changes

It seems both are necessary to get a working setup. At least the raidautorun
thing does nothing there
Comment 8 Clyde E. Kunkel 2007-01-24 14:38:23 EST
Does anyone know when mkinitrd will recognize software raid / again?  And why
isn't this bz assigned?
Comment 9 Nicolas Mailhot 2007-04-17 06:30:03 EDT
Latest mkinitrd seems to work, but is not using mdadm
Comment 10 Will Woods 2007-05-15 17:31:52 EDT
We now have a mkinitrd that uses mdadm. Could you try the updated packages from


You'll probably need both mkinitrd and nash to test.
Comment 11 Nicolas Mailhot 2007-05-16 04:58:13 EDT
Created attachment 154801 [details]

Does not work. I'm surprised as the original patch worked perfectly
Comment 12 Jeremy Katz 2007-05-18 11:51:18 EDT
Reopening based on Nicholas's comment for more investigation
Comment 13 Will Woods 2007-05-20 18:28:34 EDT
It failed to exec /sbin/mdadm with "permission denied"? Weird. I think the
system is still in the initrd at that point.. maybe we're not creating the
initrd quite right, and mdadm isn't executable?

Could you check? 'gzip -dc [initrd] | cpio -tv | grep mdadm' should do it.
Comment 14 Jeremy Katz 2007-05-21 12:47:14 EDT
Reproduced and on the fix...  give me a few minutes to test and then I'll have a
fixed build going
Comment 15 Jeremy Katz 2007-05-21 13:41:28 EDT
And built.
Comment 16 Nicolas Mailhot 2007-05-21 14:27:28 EDT
(In reply to comment #15)
> And built.
>   http://koji.fedoraproject.org/koji/buildinfo?buildID=6916

I can confirm this one works on my system

Note You need to log in before you can comment on or make changes to this bug.