mdraid_start.sh: fixed raid activation

master
Harald Hoyer 2009-09-07 14:11:18 +02:00
parent 1753a63081
commit 587b3497c1
5 changed files with 20 additions and 18 deletions

View File

@ -23,3 +23,9 @@ RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}"
RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k; /bin/ln -s /sbin/mdraid_start /initqueue/mdraid_start.sh'"

LABEL="md_inc_end"

ACTION=="add|change", \
ENV{DEVTYPE}!="partition", \
ENV{MD_LEVEL}=="container", \
TEST!="/tmp/.mdcontainer_start-%k", \
RUN+="/bin/sh -c '>/tmp/.mdcontainer_start-%k; initqueue /sbin/mdcontainer_start $env{DEVNAME}'"

View File

@ -1,6 +1,6 @@
#!/bin/bash

dracut_install mdadm partx grep
dracut_install mdadm partx


# XXX: mdmon really needs to run as non-root?
@ -32,6 +32,7 @@ if [ -x /sbin/mdmon ] ; then
fi

inst "$moddir/mdraid_start.sh" /sbin/mdraid_start
inst "$moddir/mdcontainer_start.sh" /sbin/mdcontainer_start
inst_hook pre-trigger 30 "$moddir/parse-md.sh"
inst_hook pre-pivot 30 "$moddir/mdraid-cleanup.sh"
inst_hook pre-pivot 31 "$moddir/mdraid-cleanup.sh"

View File

@ -0,0 +1,9 @@
#!/bin/sh
. /lib/dracut-lib.sh

if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
# run mdadm if udev has settled
md=$1
# and activate any containers
mdadm -IR $md 2>&1 | vinfo
fi

View File

@ -4,20 +4,6 @@ if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
[ -h "$job" ] && rm -f "$job"
# run mdadm if udev has settled
info "Assembling MD RAID arrays"

# and activate any containers
for md in /dev/md?*; do
case $md in
/dev/md*p*) ;;
*)
if mdadm --query --test --detail $md 2>&1|grep -q 'does not appear to be active'; then
info "Starting MD RAID array $md"
mdadm -R $md 2>&1 | vinfo
if mdadm --query --test --detail $md 2>&1|grep -q 'does not appear to be active'; then
mdadm -IR $md 2>&1 | vinfo
fi
udevsettle
fi
esac
done
mdadm -IRs 2>&1 | vinfo
udevsettle
fi

View File

@ -1,3 +1,3 @@
#!/bin/bash
dracut_install -o ps grep more cat rm strace free showmount
dracut_install -o ping netstat rpcinfo
dracut_install -o ping netstat rpcinfo vi