1 # This file contains the rules needed to create persistent device names.
3 # we are only interested in add actions for block devices
4 SUBSYSTEM!="block", GOTO="no_volume_id"
5 ACTION!="add", GOTO="no_volume_id"
7 # and we can safely ignore these kinds of devices
8 KERNEL=="ram*|loop*|fd*|nbd*|dm-*", GOTO="no_volume_id"
10 # skip removable ide devices, because open(2) on them causes an events loop
11 KERNEL=="hd*[!0-9]", SYSFS{removable}=="1", DRIVER=="ide-cs|ide-floppy", \
13 KERNEL=="hd*[0-9]", SYSFS{../removable}=="1", \
16 # look for different kinds of unique identificators
17 KERNEL=="hd*[!0-9]", \
18 IMPORT{program}="ata_id --export $tempnode"
20 KERNEL=="sd*[!0-9]|sr*|st*", SYSFS{ieee1394_id}=="?*", \
21 ENV{ID_BUS}="ieee1394", ENV{ID_SERIAL}="$sysfs{ieee1394_id}"
22 KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", \
23 IMPORT{program}="usb_id -x"
24 KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", \
25 IMPORT{program}="scsi_id -g -x -s $devpath -d $tempnode"
26 KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", \
27 IMPORT{program}="scsi_id -g -x -a -s $devpath -d $tempnode"
29 KERNEL=="dasd*[!0-9]", \
30 IMPORT{program}="dasd_id --export $tempnode"
33 IMPORT{program}="edd_id --export $tempnode"
35 # find the physical path of the device
36 KERNEL=="*[!0-9]|sr*|st*", IMPORT{program}="path_id $devpath"
38 # import the variables of partitions from the parent disks
39 KERNEL=="*[0-9]", IMPORT{parent}="ID_*"
41 KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", \
42 SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
43 KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", \
44 SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
45 KERNEL=="sd*[!0-9]|dasd[!0-9]*|sr*", ENV{ID_SERIAL}=="?*", \
46 SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
47 KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", \
48 SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
49 KERNEL=="st*", ENV{ID_SERIAL}=="?*", \
50 SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
51 KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", \
52 SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
53 KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", \
54 SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
56 KERNEL=="*[!0-9]|sr*", ENV{ID_PATH}=="?*", \
57 SYMLINK+="disk/by-path/$env{ID_PATH}"
58 KERNEL=="st*", ENV{ID_PATH}=="?*", \
59 SYMLINK+="tape/by-path/$env{ID_PATH}"
60 KERNEL=="sr*|st*", GOTO="no_volume_id"
61 KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", \
62 SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
64 # UUID and volume label
65 KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="no_volume_id"
66 IMPORT{program}="vol_id --export $tempnode"
67 ENV{ID_FS_UUID}=="?*", ENV{ID_FS_USAGE}=="filesystem|other", \
68 SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
69 ENV{ID_FS_LABEL_SAFE}=="?*", ENV{ID_FS_USAGE}=="filesystem|other", \
70 SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"