From: Harald Hoyer Date: Mon, 31 Aug 2009 09:40:05 +0000 (+0200) Subject: mdraid_start: check if raid is already active before trying to run it X-Git-Tag: 001~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f4c36b28f605b3bb55b0f3ec1a6cb5e6f0bad485;p=thirdparty%2Fdracut.git mdraid_start: check if raid is already active before trying to run it --- diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh index b63709c11..a6868bda0 100755 --- a/modules.d/90mdraid/mdraid_start.sh +++ b/modules.d/90mdraid/mdraid_start.sh @@ -10,9 +10,14 @@ if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then case $md in /dev/md*p*) ;; *) - info "Starting MD RAID array $md" - mdadm -R $md 2>&1 | vinfo - mdadm -IR $md 2>&1 | vinfo + 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 fi