Skip to contentSkip to conversation

udev-md-raid-assembly.rules: Skip non-ready devices

PATCH Applied NeilBrown 2 participants 2 messages Mar 27, 2017 – Mar 28, 2017 MD RAID

lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 udev-md-raid-assembly.rules: Skip non-ready devices

From: Hannes Reinecke <[email protected]>

If a device isn't fully initialized (e.g if it should be handled by multipathing) it should not be considered for md/RAID auto-assembly. Doing so can cause incorrect results such as causing multipath to fail during startup.

There is a convention that the udev environment variable SYSTEMD_READY be set to zero for such devices. So change the mdadm rules to ignore devices with SYSTEMD_READY==0.

---
 udev-md-raid-assembly.rules | 3 +++
 1 file changed, 3 insertions(+)
udev-md-raid-assembly.rules +3 -0
index d0d440a6394c..8ca232a44b1f 100644
@@ -7,6 +7,9 @@ ENV{ANACONDA}=="?*", GOTO="md_inc_end"
 
 SUBSYSTEM!="block", GOTO="md_inc_end"
 
+# skip non-initialized devices
+ENV{SYSTEMD_READY}=="0", GOTO="md_inc_end"
+
 # handle potential components of arrays (the ones supported by md)
 ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="md_inc"
 
Signature · 1 line
2.12.0
#1 lore raw
Quoted 11 lines · NeilBrown

From: Hannes Reinecke <[email protected]>

If a device isn't fully initialized (e.g if it should be handled by multipathing) it should not be considered for md/RAID auto-assembly. Doing so can cause incorrect results such as causing multipath to fail during startup.

There is a convention that the udev environment variable SYSTEMD_READY be set to zero for such devices. So change the mdadm rules to ignore devices with SYSTEMD_READY==0.

Quoted 5 lines
---
 udev-md-raid-assembly.rules | 3 +++
 1 file changed, 3 insertions(+)

Applied!

Thanks,
Jes