source: udev/60-persistent-disk.rules@ 77ce7fd

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 77ce7fd was 5b4b253, checked in by Jim Gifford <clfs@…>, 18 years ago

Update with new Rules from Kay

  • Property mode set to 100644
File size: 4.4 KB
Line 
1########################################################################
2#
3# Description : 60-persistent-disk.rules
4#
5# Authors : Based on Open Suse Udev Rules
6# kay.sievers@suse.de and hare@suse.de
7#
8# Adapted to : Jim Gifford
9# LFS
10#
11# Version : 00.01
12#
13# Notes :
14#
15########################################################################
16
17# persistent disk links: /dev/disk/{by-id,by-uuid,by-label,by-path}
18# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>
19
20ACTION!="add", GOTO="persistent_storage_end"
21
22KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
23KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
24KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst"
25
26# type 8 devices are "Medium Changers"
27KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
28KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
29KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
30
31SUBSYSTEM!="block", GOTO="persistent_storage_end"
32
33# skip rules for inappropriate block devices
34KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*", GOTO="persistent_storage_end"
35
36# Set Permissions on CDOM
37BUS=="ide", DRIVERS=="ide-cdrom", ATTRS{removable}=="1", GROUP="cdrom", MODE="660"
38
39# never access removable ide devices, the drivers are causing event loops on open()
40KERNEL=="hd*[!0-9]", ATTR{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end"
41KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end"
42
43# for partitions import parent information
44KERNEL=="*[0-9]", IMPORT{parent}=="ID_*"
45
46# by-id (hardware serial number)
47KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
48KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
49KERNEL=="hd*[0-9]", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
50
51KERNEL=="sd*[!0-9]|sr*|st*", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
52KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x"
53KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
54KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
55KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
56KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
57KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="?*", ENV{ID_VENDOR}=="ATA", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL_SHORT}"
58KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="?*", ENV{ID_VENDOR}=="ATA", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL_SHORT}-part%n"
59
60KERNEL=="mmcblk[0-9]", ATTR{name}=="?*", ATTR{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"
61KERNEL=="mmcblk[0-9]p[0-9]", ATTR{name}=="?*", ATTR{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n"
62
63# by-path (shortest physical path)
64KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
65KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}"
66KERNEL=="sr*|st*", GOTO="persistent_storage_end"
67KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
68
69# by-label/by-uuid (filesystem properties)
70KERNEL=="*[!0-9]", ATTR{removable}=="1", GOTO="persistent_storage_end"
71IMPORT{program}="vol_id --export $tempnode"
72ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
73ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
74
75# BIOS Enhanced Disk Device
76KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode"
77KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
78KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
79
80LABEL="persistent_storage_end"
Note: See TracBrowser for help on using the repository browser.