/sbin/vgchange -a n $lvmsysinit > /dev/null 2>&1
fi
- goraidtab=1
if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ]; then
if grep -qE "^([[:blank:]]|)ARRAY[[:blank:]]" /etc/mdadm.conf 2>/dev/null; then
/sbin/mdadm --stop --scan > /dev/null 2>&1
rc=$?
- [ "$rc" -eq 0 ] && goraidtab=0
fi
fi
- # turn off raid
- if [ -x /sbin/raidstop -a -f /etc/raidtab -a "$goraidtab" -eq 1 ]; then
- # we can not use raidstop -a here because this will only stop
- # devices listed in the default config file which is not always
- # the case. So we look only for the active raid devices
- if [ -f /proc/mdstat ] ; then
- mddevs=$(awk '/^md.* active/ {print $1}' /proc/mdstat)
- for mddev in $mddevs ; do
- show "Turning off RAID for %s" "$mddev"
- daemon /sbin/raidstop /dev/$mddev
- done
- unset mddev mddevs
- fi
- # runcmd "Turning off RAID" /sbin/raidstop -a
- fi
-
show "Remounting remaining filesystems ro mode"; busy
if mount | awk '/ext2|ext3|reiserfs|xfs|jfs/ { print $3 }' | while read line; do mount -n -o ro,remount $line; done; then
ok
fi
# Add raid devices
- if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ] || [ -f /etc/raidtab ]; then
+ if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ]; then
modprobe -s md
if [ -f /proc/mdstat ]; then
- goraidtab=1
golvm=0
rc=0
if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ]; then
# rc is used later, too so set sane value
rc=0
deltext; ok
- goraidtab=0
golvm=1
else
deltext; fail
fi
fi
- if [ -f /etc/raidtab -a "$goraidtab" -eq 1 ]; then
- for i in $(awk '!/^#/ && /raiddev/{print $2}' /etc/raidtab 2>/dev/null); do
- golvm=1
- RAIDDEV=$(basename $i)
- RAIDSTAT=$(grep "^$RAIDDEV : active" /proc/mdstat 2>/dev/null)
- show "Starting up RAID device %s" $RAIDDEV
- busy
- if [ -z "$RAIDSTAT" ]; then
- # Try raidstart first...if that fails then
- # fall back to raid0run and if that fails too
- # fall back to raidadd, raidrun.
- RESULT=1
- if [ -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
- fail
- else
- ok
- fi
- else
- ok
- fi
- done
- fi
-
# A non-zero return means there were problems
if [ $rc -gt 0 ]; then
[ -e /proc/splash ] && echo "verbose" > /proc/splash