]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
mdraid-cleanup: do not stop mdraid container
authorHarald Hoyer <harald@redhat.com>
Mon, 7 Sep 2009 15:53:37 +0000 (17:53 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 7 Sep 2009 17:12:00 +0000 (19:12 +0200)
modules.d/90mdraid/mdraid-cleanup.sh

index 9c4469dcc3401a8f6023fbed5270119857a026ab..dc3b86fe474322f68838ecf3390452b2585550e8 100755 (executable)
@@ -1,4 +1,15 @@
 # stop everything which is not busy
-for i in /dev/md*; do
-    mdadm --stop $i >/dev/null 2>&1
+for i in /dev/md* /dev/md/*; do
+    [ -b $i ] || continue
+
+    mddetail=$(udevadm info --query=property --name=$i)
+    case "$mddetail" in 
+       *MD_LEVEL=container*) 
+           ;;
+       *DEVTYPE=partition*)
+           ;;
+       *)
+           mdadm --stop $i >/dev/null 2>&1
+           ;;
+    esac
 done