Bug 221696

Summary: mkinitrd "forgets" raid modules
Product: [Fedora] Fedora Reporter: Nicolas Mailhot <nicolas.mailhot>
Component: mkinitrdAssignee: Peter Jones <pjones>
Status: CLOSED RAWHIDE QA Contact: Will Woods <wwoods>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: clydekunkel7734, katzj
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-21 17:41:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 213586    
Bug Blocks: 150226    
Attachments:
Description Flags
Crash none

Description Nicolas Mailhot 2007-01-06 10:05:46 UTC
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 15:06:56 UTC
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 15:08:51 UTC
(tested with the patch in bug #213586 & the resulting initrd worked)

mkinitrd-6.0.6-1

Comment 3 Clyde E. Kunkel 2007-01-11 05:10:54 UTC
#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 08:00:12 UTC
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" ;;
         esac
-        if [[ "$device" =~ "md[0-9]+" ]]; then
+        if [[ "$device" =~ ^md[0-9]+$ ]]; then
             vecho "Found RAID component $device"
             handleraid "$device"
             continue
@@ -1222,6 +1222,13 @@
     mknod $MNTIMAGE/dev/efirtc c 10 136
 fi
 
+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
+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}"
     done
 fi



Comment 5 Nicolas Mailhot 2007-01-11 12:15:57 UTC
(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-13 01:46:18 UTC
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 11:52:11 UTC
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 19:38:23 UTC
Does anyone know when mkinitrd will recognize software raid / again?  And why
isn't this bz assigned?

Comment 9 Nicolas Mailhot 2007-04-17 10:30:03 UTC
Latest mkinitrd seems to work, but is not using mdadm

Comment 10 Will Woods 2007-05-15 21:31:52 UTC
We now have a mkinitrd that uses mdadm. Could you try the updated packages from
koji:

http://koji.fedoraproject.org/koji/buildinfo?buildID=6450

You'll probably need both mkinitrd and nash to test.

Comment 11 Nicolas Mailhot 2007-05-16 08:58:13 UTC
Created attachment 154801 [details]
Crash

Does not work. I'm surprised as the original patch worked perfectly

Comment 12 Jeremy Katz 2007-05-18 15:51:18 UTC
Reopening based on Nicholas's comment for more investigation

Comment 13 Will Woods 2007-05-20 22:28:34 UTC
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 16:47:14 UTC
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 17:41:28 UTC
And built.
  http://koji.fedoraproject.org/koji/buildinfo?buildID=6916

Comment 16 Nicolas Mailhot 2007-05-21 18:27:28 UTC
(In reply to comment #15)
> And built.
>   http://koji.fedoraproject.org/koji/buildinfo?buildID=6916

I can confirm this one works on my system