summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/shutdown/umount.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c
index 3e9e241499..820aa8e286 100644
--- a/src/shutdown/umount.c
+++ b/src/shutdown/umount.c
@@ -352,9 +352,14 @@ static int md_list_get(MountPoint **head) {
if (r < 0)
return r;
+ /* Filter out partitions. */
+ r = sd_device_enumerator_add_match_property(e, "DEVTYPE", "disk");
+ if (r < 0)
+ return r;
+
FOREACH_DEVICE(e, d) {
_cleanup_free_ char *p = NULL;
- const char *dn;
+ const char *dn, *md_level;
MountPoint *m;
dev_t devnum;
@@ -362,6 +367,17 @@ static int md_list_get(MountPoint **head) {
sd_device_get_devname(d, &dn) < 0)
continue;
+ r = sd_device_get_property_value(d, "MD_LEVEL", &md_level);
+ if (r < 0) {
+ log_warning_errno(r, "Failed to get MD_LEVEL property for %s, ignoring: %m", dn);
+ continue;
+ }
+
+ /* MD "containers" are a special type of MD devices, used for external metadata.
+ * Since it doesn't provide RAID functionality in itself we don't need to stop it. */
+ if (streq(md_level, "container"))
+ continue;
+
p = strdup(dn);
if (!p)
return -ENOMEM;