home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / udev / rules.d / 65-persistent-storage.rules < prev    next >
Encoding:
Text File  |  2007-04-10  |  3.8 KB  |  66 lines

  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|change", GOTO="persistent_storage_start"
  5. GOTO="persistent_storage_end"
  6.  
  7. LABEL="persistent_storage_start"
  8.  
  9. KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
  10. KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
  11. KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst"
  12.  
  13. # type 8 devices are "Medium Changers"
  14. KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
  15. KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
  16. KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
  17.  
  18. SUBSYSTEM!="block", GOTO="persistent_storage_end"
  19.  
  20. # skip rules for inappropriate block devices
  21. KERNEL=="ram*|loop*|fd*|nbd*|gnbd*", GOTO="persistent_storage_end"
  22.  
  23. # never access non-cdrom removable ide devices, the drivers are causing event loops on open()
  24. KERNEL=="hd*[!0-9]", ATTR{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end"
  25. KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end"
  26.  
  27. # never add uuid information for whole disk
  28. ATTR{whole_disk}=="", GOTO="persistent_storage_end"
  29.  
  30. # for partitions import parent information
  31. KERNEL=="*[0-9]", IMPORT{parent}="ID_*"
  32.  
  33. # by-id (hardware serial number)
  34. KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
  35. KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
  36. KERNEL=="hd*[0-9]", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
  37.  
  38. KERNEL=="sd*[!0-9]|sr*|st*", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
  39. KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x"
  40. KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
  41. KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
  42. KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
  43. KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
  44.  
  45. KERNEL=="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}"
  46. KERNEL=="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"
  47.  
  48. # by-path (shortest physical path)
  49. KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
  50. KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}"
  51. KERNEL=="sr*|st*", GOTO="persistent_storage_end"
  52. KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
  53.  
  54. # by-label/by-uuid (filesystem properties)
  55. KERNEL=="*[!0-9]", ATTR{removable}=="1", GOTO="persistent_storage_end"
  56. IMPORT{program}="vol_id --export $tempnode"
  57. ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
  58. ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
  59.  
  60. # BIOS Enhanced Disk Device
  61. KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode"
  62. KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
  63. KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
  64.  
  65. LABEL="persistent_storage_end"
  66.