febac90a651d9a664304a7df91a9522a6b754743
[multipath-tools/.git] / kpartx / kpartx.rules
1 #
2 # persistent links for device-mapper devices
3 # only hardware-backed device-mapper devices (ie multipath, dmraid,
4 # and kpartx) have meaningful persistent device names
5 #
6
7 KERNEL!="dm-*", GOTO="kpartx_end"
8 ACTION=="remove", GOTO="kpartx_end"
9
10 ENV{DM_TABLE_STATE}!="LIVE", GOTO="kpartx_end"
11
12 ENV{DM_UUID}=="?*", IMPORT{program}=="kpartx_id %M %m $env{DM_UUID}"
13
14 OPTIONS="link_priority=50"
15
16 # Create persistent links for multipath tables
17 ENV{DM_UUID}=="mpath-*", \
18         SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}"
19
20 # Create persistent links for partitions
21 ENV{DM_PART}=="?*", \
22         SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}-part$env{DM_PART}"
23
24 # Create dm tables for partitions
25 ENV{DM_STATE}!="SUSPENDED", ENV{DM_UUID}=="mpath-*", \
26         RUN+="/sbin/kpartx -u -p -part /dev/$name"
27
28 LABEL="kpartx_end"
29
30