]> TLD Linux GIT Repositories - packages/rc-scripts.git/commitdiff
- don't try to assemble arrays if there are some in /proc/mdstat already
authorMarcin Krol <hawk@tld-linux.org>
Fri, 25 Jul 2014 16:52:28 +0000 (16:52 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Fri, 25 Jul 2014 16:52:28 +0000 (16:52 +0000)
  (removes "FAIL" when trying to activate already active arrays)

rc-scripts-raid.patch

index c2d6d7671ee3cbf097362887763af0541a86d66e..72bf0d976a38ffa0c27fbcf57fe7a4dfa10ac355 100644 (file)
@@ -1,7 +1,7 @@
 diff -ur rc-scripts-0.4.12.orig/rc.d/rc.sysinit rc-scripts-0.4.12/rc.d/rc.sysinit
 --- rc-scripts-0.4.12.orig/rc.d/rc.sysinit     2014-06-19 20:04:44.000000000 +0000
-+++ rc-scripts-0.4.12/rc.d/rc.sysinit  2014-07-22 16:10:23.162000000 +0000
-@@ -305,61 +305,16 @@
++++ rc-scripts-0.4.12/rc.d/rc.sysinit  2014-07-25 16:08:09.735000000 +0000
+@@ -305,61 +305,18 @@
  
  # mdadm - manage MD devices aka Linux Software RAID
  init_mdadm() {
@@ -19,7 +19,9 @@ diff -ur rc-scripts-0.4.12.orig/rc.d/rc.sysinit rc-scripts-0.4.12/rc.d/rc.sysini
 -      # assume we have md if at least one ARRAY line is present
 -      if grep -qE "^([[:blank:]]|)ARRAY[[:blank:]]" /etc/mdadm.conf; then
 -              have_md=1
--      fi
++      if ! grep -q -E "^md.*active" /proc/mdstat; then
++              run_cmd "Starting up RAID devices" /sbin/mdadm --assemble --scan
+       fi
 -      # configured to do auto scanning
 -      if [ $have_md = 0 ] && grep -qE "^([[:blank:]]|)DEVICE[[:blank:]]partitions" /etc/mdadm.conf; then
 -              have_md=1
@@ -61,11 +63,10 @@ diff -ur rc-scripts-0.4.12.orig/rc.d/rc.sysinit rc-scripts-0.4.12/rc.d/rc.sysini
 -      fi
 -      show "Starting up RAID devices"; ok
 -      return $rc
-+      run_cmd "Starting up RAID devices" /sbin/mdadm --assemble --scan
  }
  
  # Init LVM
-@@ -832,7 +787,10 @@
+@@ -832,7 +789,10 @@
                fi
        fi
  
@@ -77,7 +78,7 @@ diff -ur rc-scripts-0.4.12.orig/rc.d/rc.sysinit rc-scripts-0.4.12/rc.d/rc.sysini
        if ! is_no "$LVM2"; then
                init_lvm
        fi
-@@ -844,10 +802,6 @@
+@@ -844,10 +804,6 @@
                [ $delay_cryptsetup = 0 ] && ok || fail
        fi