From: John Huttley Date: Sun, 07 Jun 2009 10:04:51 +0000 Subject: Re: Mapping /dev/*st0* to fixed names using scsi_id Message-Id: <4A2B90C3.4000408@mib-infotech.co.nz> List-Id: References: <18982.53980.652743.304603@stoffel.org> In-Reply-To: <18982.53980.652743.304603@stoffel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Hi, I had similar issues with my collection of scsi tape drives, not all of which may be powered up. the --page=0x80 does the trick. my kernel is compiled with the SG version4 block device option enabled. this is my 60-persistent-storage-tape.rules, hope it helps ACTION!="add|change", GOTO="persistent_storage_tape_end" # type 8 devices are "Medium Changers" KERNEL="sg[0-9]*", SUBSYSTEMS="scsi", ATTRS{type}="8", IMPORT{program}="scsi_id --sg-version=3 --page=0x80 --export --whitelisted -d $tempnode", SYMLINK+="tape/by-id/$env{ID_VENDOR}-$env{ID_MODEL}-$env{ID_SERIAL_SHORT}" SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end" KERNEL="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394" KERNEL="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS="usb", IMPORT{program}="usb_id --export %p" KERNEL="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS="scsi", KERNELS="[0-9]*:*[0-9]", ENV{BSG_DEV}="$root/bsg/$id" KERNEL="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", WAIT_FOR="$env{BSG_DEV}", IMPORT="scsi_id --page=0x80 --whitelisted --export --device=$env{BSG_DEV}", ENV{ID_BUS}="scsi" KERNEL="st*[0-9]", ENV{ID_SERIAL}="?*", SYMLINK+="tape/by-id/$env{ID_VENDOR}-$env{ID_MODEL}-$env{ID_SERIAL_SHORT}" KERNEL="nst*[0-9]", ENV{ID_SERIAL}="?*", SYMLINK+="tape/by-id/$env{ID_VENDOR}-$env{ID_MODEL}-$env{ID_SERIAL_SHORT}-nst" # by-path (shortest physical path) KERNEL="st*[0-9]", IMPORT{program}="path_id %p" KERNEL="st*[0-9]", ENV{ID_PATH}="?*", SYMLINK+="tape/by-path/$env{ID_PATH}" LABEL="persistent_storage_tape_end"