]> git.ipfire.org Git - thirdparty/mdadm.git/blame - udev-md-raid-assembly.rules
sysfs: Use the presence of /sys/block/<dev>/md as indicator of valid device
[thirdparty/mdadm.git] / udev-md-raid-assembly.rules
CommitLineData
2452f13a
TB
1# do not edit this file, it will be overwritten on update
2
05ec50a5
N
3# Don't process any events if anaconda is running as anaconda brings up
4# raid devices manually
5ENV{ANACONDA}=="?*", GOTO="md_inc_end"
2452f13a
TB
6# assemble md arrays
7
8SUBSYSTEM!="block", GOTO="md_inc_end"
9
3a77acd7
HR
10# skip non-initialized devices
11ENV{SYSTEMD_READY}=="0", GOTO="md_inc_end"
12
2452f13a 13# handle potential components of arrays (the ones supported by md)
05ec50a5
N
14ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="md_inc"
15
16# "noiswmd" on kernel command line stops mdadm from handling
17# "isw" (aka IMSM - Intel RAID).
18# "nodmraid" on kernel command line stops mdadm from handling
19# "isw" or "ddf".
20IMPORT{cmdline}="noiswmd"
21IMPORT{cmdline}="nodmraid"
22
23ENV{nodmraid}=="?*", GOTO="md_inc_end"
24ENV{ID_FS_TYPE}=="ddf_raid_member", GOTO="md_inc"
25ENV{noiswmd}=="?*", GOTO="md_inc_end"
26ENV{ID_FS_TYPE}=="isw_raid_member", GOTO="md_inc"
2452f13a
TB
27GOTO="md_inc_end"
28
29LABEL="md_inc"
30
31# remember you can limit what gets auto/incrementally assembled by
32# mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY'
85945e19 33ACTION=="add|change", IMPORT{program}="BINDIR/mdadm --incremental --export $devnode --offroot ${DEVLINKS}"
25392f5f 34ACTION=="add|change", ENV{MD_STARTED}=="*unsafe*", ENV{MD_FOREIGN}=="no", ENV{SYSTEMD_WANTS}+="mdadm-last-resort@$env{MD_DEVICE}.timer"
85945e19
N
35ACTION=="remove", ENV{ID_PATH}=="?*", RUN+="BINDIR/mdadm -If $name --path $env{ID_PATH}"
36ACTION=="remove", ENV{ID_PATH}!="?*", RUN+="BINDIR/mdadm -If $name"
2452f13a
TB
37
38LABEL="md_inc_end"