]>
Commit | Line | Data |
---|---|---|
e001bff3 MT |
1 | # persistent storage links: /dev/{disk,tape}/{by-id,by-uuid,by-label,by-path,by-name} |
2 | # scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de> | |
3 | ||
4 | ACTION!="add", GOTO="persistent_storage_end" | |
5 | SUBSYSTEM!="block", GOTO="persistent_storage_end" | |
6 | ||
7 | # skip rules for inappropriate block devices | |
8 | KERNEL=="ram*|loop*|fd*|nbd*", GOTO="persistent_storage_end" | |
9 | ||
10 | # never access removable ide devices, the drivers are causing event loops on open() | |
11 | KERNEL=="hd*[!0-9]", SYSFS{removable}=="1", DRIVER=="ide-cs|ide-floppy", GOTO="persistent_storage_end" | |
12 | KERNEL=="hd*[0-9]", SYSFS{../removable}=="1", GOTO="persistent_storage_end" | |
13 | ||
14 | # for partitions import parent information | |
15 | KERNEL=="*[0-9]", IMPORT{parent}=="ID_*" | |
16 | ||
17 | # by-id (hardware serial number) | |
18 | KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode" | |
19 | KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}" | |
20 | KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n" | |
21 | ||
22 | KERNEL=="sd*[!0-9]|sr*|st*", SYSFS{ieee1394_id}=="*", ENV{ID_SERIAL}="$sysfs{ieee1394_id}", ENV{ID_BUS}="ieee1394" | |
23 | KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x" | |
24 | KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode" | |
25 | KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode" | |
26 | KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode" | |
27 | KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" | |
28 | KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" | |
29 | KERNEL=="st*", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}" | |
30 | ||
31 | # by-path (shortest physical path) | |
32 | KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}" | |
33 | KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}" | |
34 | KERNEL=="sr*|st*", GOTO="persistent_storage_end" | |
35 | KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" | |
36 | ||
37 | # by-label/by-uuid (filesystem properties) | |
38 | KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="persistent_storage_end" | |
39 | IMPORT{program}="vol_id --export $tempnode" | |
40 | ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}" | |
41 | ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}" | |
42 | ||
43 | # BIOS Enhanced Disk Device | |
44 | KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode" | |
45 | KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}" | |
46 | KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n" | |
47 | ||
48 | ||
49 | LABEL="persistent_storage_end" |