Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 11959

Summary: Starting software RAID fails with multipul /dev/md#
Product: Gentoo Linux Reporter: Rami AlZaid <rami>
Component: [OLD] Core systemAssignee: Martin Schlemmer (RETIRED) <azarah>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: acooks, aliz, bug-wranglers, vapier
Priority: High    
Version: 1.4_rc1   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Rami AlZaid 2002-12-11 07:27:17 UTC
checkfs fails when trying to start software raid since if there were more than
one device the if [ -n ${ACTIVE_RAID} ] would be invalid and so would the grep -v.
A quick patch to this problem is as follows (I don't think it's the best
solution though but that's what I was able to think of for now):

--- checkfs.old Wed Dec 11 18:12:39 2002
+++ checkfs.new Wed Dec 11 19:23:21 2002
@@ -33,12 +33,22 @@
        then
                ebegin "Starting software RAID"
                ACTIVE_RAID="`grep -E "md[0-9]+[[:space:]]?: active raid"
/proc/mdstat | awk -F ':' '{print "/dev/"$1}'`"
-               if [ -n ${ACTIVE_RAID} ]
+               if [ `echo ${ACTIVE_RAID} | awk 'BEGIN { ORS=""}{ for (i = 1; i
<= NF; i++) if (i<2) print "-n "$i; else print " -a -n "$i; }'` ]
                then
-                       for x in $(grep -E "raiddev /dev/md[0-9]+" /etc/raidtab | \
-                                  awk '{print $2}' | grep -v "`echo
${ACTIVE_RAID} | sed s'/[[:space:]]//g'`")
+                       for x in $(grep -E "raiddev /dev/md[0-9]+" /etc/raidtab
| awk '{print $2}')
                        do
-                               /sbin/raidstart ${x}
+                               RAIDSTART=0
+                               for z in ${ACTIVE_RAID}
+                               do
+                                       if [ ${z} == ${x} ]
+                                       then
+                                               RAIDSTART=1
+                                       fi
+                               done
+                               if [ ${RAIDSTART} -eq 0 ]
+                               then
+                                       /sbin/raidstart ${x}
+                               fi
                        done
                else
                        /sbin/raidstart --all
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-25 17:30:36 UTC
Aliz, can you or Spanky have a look here ?
Comment 2 Andrew Cooks (RETIRED) gentoo-dev 2003-11-29 13:15:50 UTC
This bug is about to die of old age.

/etc/init.d/checkfs has changed since the bug was filed. Can someone verify whether the problem persists and reopen if it does?