]> git.ipfire.org Git - thirdparty/dracut.git/blobdiff - modules.d/90dm/dm-shutdown.sh
90dm: fixup dependency cycle between MD and DM shutdown
[thirdparty/dracut.git] / modules.d / 90dm / dm-shutdown.sh
index 4e2e2602c8c43a0c70f4d3436ace4a34c23fd741..b23836f4e27331bcf9600d5f74ff33c0e78206fc 100755 (executable)
@@ -9,8 +9,18 @@ _remove_dm() {
         [ -e ${s} ] || continue
         _remove_dm ${s##*/}
     done
-    devname=$(cat /sys/block/${dev}/dm/name)
-    dmsetup -v --noudevsync remove "$devname" || return $?
+    # multipath devices might have MD devices on top,
+    # which are removed after this script. So do not
+    # remove those to avoid spurious errors
+    case $(cat /sys/block/${dev}/dm/uuid) in
+        mpath-*)
+            return 0
+            ;;
+        *)
+            devname=$(cat /sys/block/${dev}/dm/name)
+            dmsetup -v --noudevsync remove "$devname" || return $?
+            ;;
+    esac
     return 0
 }