Rename the README to README.md
[multipath-tools/.git] / kpartx / del-part-nodes.rules
1 # These rules can delete partitions devnodes for slave devices
2 # for certain aggregate devices such as multipath.
3 # This is desirable to avoid confusion and keep the number
4 # of device nodes and symlinks within limits.
5 #
6 # This is done only once on the first "add" or "change" event for
7 # any given device.
8 #
9 # To suppress this, use the kernel parameter "dont_del_part_nodes",
10 # or create an udev rule file that sets ENV{DONT_DEL_PART_NODES}="1".
11
12 SUBSYSTEM!="block", GOTO="end_del_part_nodes"
13 KERNEL!="sd*|dasd*", GOTO="end_del_part_nodes"
14 ACTION!="add|change", GOTO="end_del_part_nodes"
15 ENV{DEVTYPE}=="partition", GOTO="end_del_part_nodes"
16
17 IMPORT{cmdline}="dont_del_part_nodes"
18 ENV{dont_del_part_nodes}=="1", GOTO="end_del_part_nodes"
19 ENV{DONT_DEL_PART_NODES}=="1", GOTO="end_del_part_nodes"
20
21 # dm-multipath
22 ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="del_part_nodes"
23
24 # Other aggregate device types can be added here.
25
26 GOTO="end_del_part_nodes"
27
28 LABEL="del_part_nodes"
29 IMPORT{db}="DM_DEL_PART_NODES"
30 ENV{DM_DEL_PART_NODES}!="1", ENV{DM_DEL_PART_NODES}="1", \
31         RUN+="/usr/sbin/partx -d --nr 1-1024 $env{DEVNAME}"
32
33 LABEL="end_del_part_nodes"