This simple patch to /etc/rc.sysinit make it mdadm-aware. Please schedule it
for inclusion.
--
Guillaume Rousse <[EMAIL PROTECTED]>
GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html
--- /etc/rc.sysinit.old Tue Jun 18 14:19:43 2002
+++ /etc/rc.sysinit Tue Jun 18 15:09:58 2002
@@ -749,49 +749,66 @@
modprobe md >/dev/null 2>&1
fi
-if [ -f /proc/mdstat -a -f /etc/raidtab ]; then
+if [ -f /proc/mdstat ]; then
gprintf "Starting up RAID devices: "
rc=0
+
+ if [ -f /etc/raidtab ]; then
- for i in `grep "^[^*]*raiddev" /etc/raidtab | awk '{print $2}'`
- do
- RAIDDEV=`basename $i`
- RAIDSTAT=`grep "^$RAIDDEV : active" /proc/mdstat`
- if [ -z "$RAIDSTAT" ]; then
- # First scan the /etc/fstab for the "noauto"-flag
- # for this device. If found, skip the initialization
- # for it to avoid dropping to a shell on errors.
- # If not, try raidstart...if that fails then
- # fall back to raidadd, raidrun. If that
- # also fails, then we drop to a shell
- RESULT=1
- NOAUTO=`grep "^$i" /etc/fstab | grep -c "noauto"`
- if [ $NOAUTO -gt 0 ]; then
- RESULT=0
- RAIDDEV="$RAIDDEV(skipped)"
- fi
- if [ $RESULT -gt 0 -a -x /sbin/raidstart ]; then
- /sbin/raidstart $i
- RESULT=$?
+ for i in `grep "^[^*]*raiddev" /etc/raidtab | awk '{print $2}'`
+ do
+ RAIDDEV=`basename $i`
+ RAIDSTAT=`grep "^$RAIDDEV : active" /proc/mdstat`
+ if [ -z "$RAIDSTAT" ]; then
+ # First scan the /etc/fstab for the "noauto"-flag
+ # for this device. If found, skip the initialization
+ # for it to avoid dropping to a shell on errors.
+ # If not, try raidstart...if that fails then
+ # fall back to raidadd, raidrun. If that
+ # also fails, then we drop to a shell
+ RESULT=1
+ NOAUTO=`grep "^$i" /etc/fstab | grep -c "noauto"`
+ if [ $NOAUTO -gt 0 ]; then
+ RESULT=0
+ RAIDDEV="$RAIDDEV(skipped)"
+ fi
+ if [ $RESULT -gt 0 -a -x /sbin/raidstart ]; then
+ /sbin/raidstart $i
+ RESULT=$?
+ fi
+ if [ $RESULT -gt 0 -a -x /sbin/raid0run ]; then
+ /sbin/raid0run $i
+ RESULT=$?
+ fi
+ if [ $RESULT -gt 0 -a -x /sbin/raidadd -a -x /sbin/raidrun ]; then
+ /sbin/raidadd $i
+ /sbin/raidrun $i
+ RESULT=$?
+ fi
+ if [ $RESULT -gt 0 ]; then
+ rc=1
+ fi
+ echo -n "$RAIDDEV "
+ else
+ echo -n "$RAIDDEV "
fi
- if [ $RESULT -gt 0 -a -x /sbin/raid0run ]; then
- /sbin/raid0run $i
- RESULT=$?
- fi
- if [ $RESULT -gt 0 -a -x /sbin/raidadd -a -x /sbin/raidrun ]; then
- /sbin/raidadd $i
- /sbin/raidrun $i
+ done
+
+ fi
+
+ if [ -f /etc/mdadm.conf ]; then
+ ARRAYS=`grep "^DEVICE" /etc/mdadm.conf`
+ if [ -n "$ARRAYS" ]; then
+ if [ -x /sbin/mdadm ]; then
+ /sbin/mdadm --assemble --scan
RESULT=$?
fi
if [ $RESULT -gt 0 ]; then
rc=1
fi
- echo -n "$RAIDDEV "
- else
- echo -n "$RAIDDEV "
fi
- done
+ fi
# A non-zero return means there were problems.
if [ $rc -gt 0 ]; then