]> git.ipfire.org Git - thirdparty/mdadm.git/blame - udev-md-raid-arrays.rules
mdadm/clustermd_tests: add test case to test grow_resize cluster-raid10
[thirdparty/mdadm.git] / udev-md-raid-arrays.rules
CommitLineData
757a5d74
N
1# do not edit this file, it will be overwritten on update
2
3SUBSYSTEM!="block", GOTO="md_end"
757a5d74 4
7efa6bc3
N
5# handle md arrays
6ACTION!="add|change", GOTO="md_end"
757a5d74
N
7KERNEL!="md*", GOTO="md_end"
8
fa509028
N
9# partitions have no md/{array_state,metadata_version}, but should not
10# for that reason be ignored.
11ENV{DEVTYPE}=="partition", GOTO="md_ignore_state"
12
757a5d74
N
13# container devices have a metadata version of e.g. 'external:ddf' and
14# never leave state 'inactive'
15ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state"
5b7e273a 16TEST!="md/array_state", ENV{SYSTEMD_READY}="0", GOTO="md_end"
339b7746 17ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0", GOTO="md_end"
757a5d74
N
18LABEL="md_ignore_state"
19
85945e19 20IMPORT{program}="BINDIR/mdadm --detail --export $devnode"
67732c39 21ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace"
757a5d74
N
22ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}"
23ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}"
67732c39 24ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace"
757a5d74
N
25ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n"
26ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n"
27ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n"
28
3ab6bf30 29IMPORT{builtin}="blkid"
757a5d74 30OPTIONS+="link_priority=100"
2913d9df 31OPTIONS+="watch"
757a5d74
N
32ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
33ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
34
61c09471
N
35ENV{MD_LEVEL}=="raid[1-9]*", ENV{SYSTEMD_WANTS}+="mdmonitor.service"
36
8d1d32bb
N
37# Tell systemd to run mdmon for our container, if we need it.
38ENV{MD_LEVEL}=="raid[1-9]*", ENV{MD_CONTAINER}=="?*", PROGRAM="/usr/bin/readlink $env{MD_CONTAINER}", ENV{MD_MON_THIS}="%c"
39ENV{MD_MON_THIS}=="?*", PROGRAM="/usr/bin/basename $env{MD_MON_THIS}", ENV{SYSTEMD_WANTS}+="mdmon@%c.service"
40
757a5d74 41LABEL="md_end"