multipath -u: don't grab devices already passed to system
[multipath-tools/.git] / multipath / multipath.rules
1 # Set DM_MULTIPATH_DEVICE_PATH if the device should be handled by multipath
2 SUBSYSTEM!="block", GOTO="end_mpath"
3 KERNEL!="sd*|dasd*|nvme*", GOTO="end_mpath"
4 ACTION=="remove", TEST=="/dev/shm/multipath/find_multipaths/$major:$minor", \
5         RUN+="/usr/bin/rm -f /dev/shm/multipath/find_multipaths/$major:$minor"
6 ACTION!="add|change", GOTO="end_mpath"
7
8 IMPORT{cmdline}="nompath"
9 ENV{nompath}=="?*", GOTO="end_mpath"
10 IMPORT{cmdline}="multipath"
11 ENV{multipath}=="off", GOTO="end_mpath"
12
13 ENV{DEVTYPE}!="partition", GOTO="test_dev"
14 IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH"
15 ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{ID_FS_TYPE}="none", \
16         ENV{SYSTEMD_READY}="0"
17 GOTO="end_mpath"
18
19 LABEL="test_dev"
20
21 ENV{MPATH_SBIN_PATH}="/sbin"
22 TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin"
23
24 # multipath -u needs to know if this device has ever been exported
25 IMPORT{db}="DM_MULTIPATH_DEVICE_PATH"
26
27 # multipath -u sets DM_MULTIPATH_DEVICE_PATH
28 IMPORT{program}="$env{MPATH_SBIN_PATH}/multipath -u %k"
29 ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{ID_FS_TYPE}="mpath_member", \
30         ENV{SYSTEMD_READY}="0"
31
32 LABEL="end_mpath"