linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Huttley <John@mib-infotech.co.nz>
To: linux-hotplug@vger.kernel.org
Subject: Re: Mapping /dev/*st0* to fixed names using scsi_id
Date: Sun, 07 Jun 2009 10:04:51 +0000	[thread overview]
Message-ID: <4A2B90C3.4000408@mib-infotech.co.nz> (raw)
In-Reply-To: <18982.53980.652743.304603@stoffel.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"


  parent reply	other threads:[~2009-06-07 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03 19:45 Mapping /dev/*st0* to fixed names using scsi_id John Stoffel
2009-06-04 21:03 ` John Stoffel
2009-06-07 10:04 ` John Huttley [this message]
2009-06-09 15:27 ` John Stoffel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A2B90C3.4000408@mib-infotech.co.nz \
    --to=john@mib-infotech.co.nz \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).