Browse Source

mdraid_start.sh: fixed raid activation

master
Harald Hoyer 16 years ago
parent
commit
587b3497c1
  1. 6
      modules.d/90mdraid/65-md-incremental-imsm.rules
  2. 3
      modules.d/90mdraid/install
  3. 9
      modules.d/90mdraid/mdcontainer_start.sh
  4. 18
      modules.d/90mdraid/mdraid_start.sh
  5. 2
      modules.d/95debug/install

6
modules.d/90mdraid/65-md-incremental-imsm.rules

@ -23,3 +23,9 @@ RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}" @@ -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}'"

3
modules.d/90mdraid/install

@ -1,6 +1,6 @@ @@ -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 @@ -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"

9
modules.d/90mdraid/mdcontainer_start.sh

@ -0,0 +1,9 @@ @@ -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

18
modules.d/90mdraid/mdraid_start.sh

@ -4,20 +4,6 @@ if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then @@ -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

2
modules.d/95debug/install

@ -1,3 +1,3 @@ @@ -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

Loading…
Cancel
Save