]>
Commit | Line | Data |
---|---|---|
757a5d74 N |
1 | # do not edit this file, it will be overwritten on update |
2 | ||
3 | SUBSYSTEM!="block", GOTO="md_end" | |
4 | ACTION!="add|change", GOTO="md_end" | |
a9934ce4 | 5 | ACTION=="change", GOTO="md_no_incr" |
757a5d74 N |
6 | |
7 | # import data from a raid member and activate it | |
8 | #ENV{ID_FS_TYPE}=="linux_raid_member", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" | |
9 | # import data from a raid set | |
a9934ce4 | 10 | LABEL="md_no_incr" |
757a5d74 N |
11 | KERNEL!="md*", GOTO="md_end" |
12 | ||
fa509028 N |
13 | # partitions have no md/{array_state,metadata_version}, but should not |
14 | # for that reason be ignored. | |
15 | ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" | |
16 | ||
757a5d74 N |
17 | # container devices have a metadata version of e.g. 'external:ddf' and |
18 | # never leave state 'inactive' | |
19 | ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" | |
fabf4941 | 20 | TEST!="md/array_state", GOTO="md_end" |
757a5d74 N |
21 | ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" |
22 | LABEL="md_ignore_state" | |
23 | ||
24 | IMPORT{program}="/sbin/mdadm --detail --export $tempnode" | |
67732c39 | 25 | ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" |
757a5d74 N |
26 | ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" |
27 | ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" | |
67732c39 | 28 | ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" |
757a5d74 N |
29 | ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n" |
30 | ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" | |
31 | ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" | |
32 | ||
5bac0443 | 33 | IMPORT{program}="/sbin/blkid -o udev -p $tempnode" |
757a5d74 N |
34 | OPTIONS+="link_priority=100" |
35 | ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" | |
36 | ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" | |
37 | ||
38 | LABEL="md_end" |