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