From 0fe4cffde6628b54af6163b2fc253fb9bc556ded Mon Sep 17 00:00:00 2001 From: Jamie Wellnitz Date: Tue, 27 Feb 2007 21:02:07 +0100 Subject: persistent device naming: tape devices and medium changers This adds persistent symlinks for nst tape devices to the example rules. The symlinks live under /dev/tape/by-id/. Signed-off-by: Jamie Wellnitz --- etc/udev/rules.d/60-persistent-storage.rules | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/udev/rules.d/60-persistent-storage.rules b/etc/udev/rules.d/60-persistent-storage.rules index a0cb8caa68..ef9cb3f28b 100644 --- a/etc/udev/rules.d/60-persistent-storage.rules +++ b/etc/udev/rules.d/60-persistent-storage.rules @@ -2,6 +2,19 @@ # scheme based on "Linux persistent device names", 2004, Hannes Reinecke ACTION!="add", GOTO="persistent_storage_end" +ACTION!="add", GOTO="persistent_tape_end" + +KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode" +KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode" +KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst" + +# type 8 devices are "Medium Changers" +KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode" +KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode" +KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}" + +LABEL="persistent_tape_end" + SUBSYSTEM!="block", GOTO="persistent_storage_end" # skip rules for inappropriate block devices @@ -26,7 +39,6 @@ KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode" KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" -KERNEL=="st*", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}" 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}" 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" -- cgit v1.2.3-54-g00ecf