linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John Stoffel" <john@stoffel.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: howto get serial number of a tape drive?
Date: Mon, 06 Jul 2009 18:22:00 +0000	[thread overview]
Message-ID: <19026.16584.136177.940234@stoffel.org> (raw)
In-Reply-To: <19026.7962.882759.229031@stoffel.org>

>>>>> "Kay" = Kay Sievers <kay.sievers@vrfy.org> writes:

Kay> On Mon, Jul 6, 2009 at 17:58, John Stoffel<john@stoffel.org> wrote:
>> I'm trying to make sure that my tape drives get named properly on
>> bootup in my tape library.  As far as I can determine, the
>> /lib/udev/scsi_id command requires that you use the SCSI Generic
>> device for the inquiry.

Kay> Some tape nodes don't like to be opened, they rewind the tape,
Kay> that's why they are not used.

That's fine, since I can poke at the SG device for the tape drive and
get it's serial number.  And I think I can write a UDEV rule to do so,
if I can figure out how to map a SCSI_TAPE device to it's SCSI_GENERIC
device. 

>> How do I map from /dev/st0 to /dev/sg? within a udev rule so I can
>> pull out the proper serial number?

Kay> The old sg stuff willnot work, bsg has the same name as the SCSI
Kay> LUN and is guaranteed to be there.

So I should be running /lib/udev/scsi_id at the bsg device?  Is that
device kept in an environment variable?  

>> I've looked at the 60-persistent-storage-tape.rules file, but it
>> doesn't seem to help, or I'm just being dense somewhere?

Kay> Which udev version? What's missing in /dev/tape/?

I'm using a Debian testing system running udev 141 right now.  Right
now in /dev/tape I have:

  > find /dev/tape
  /dev/tape
  /dev/tape/by-path
  /dev/tape/by-path/pci-0000:00:0d.1-scsi-0:0:2:0-st
  /dev/tape/by-path/pci-0000:00:0d.1-scsi-0:0:2:0-nst-nst
  /dev/tape/by-path/pci-0000:00:0d.0-scsi-0:0:3:0-st
  /dev/tape/by-path/pci-0000:00:0d.0-scsi-0:0:3:0-nst-nst

Do I need to pull out the various #:#:#:# part of the by-path stuff to
figure out which device ID I need to query against to get my low level
SCSI ID?  

Sorry to be asking so many questions, but udev isn't the easiest thing
to wrap my brain around for some reason.

Please let me know if I need to provide more details or information.

Thanks,
John


  parent reply	other threads:[~2009-07-06 18:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-06 15:58 howto get serial number of a tape drive? John Stoffel
2009-07-06 16:09 ` Kay Sievers
2009-07-06 18:22 ` John Stoffel [this message]
2009-07-06 19:56 ` John Stoffel
2009-07-06 23:00 ` Kay Sievers
2009-07-06 23:02 ` Kay Sievers
2009-07-07  1:08 ` John Stoffel
2009-07-07  3:12 ` John Stoffel
2009-07-07  7:50 ` Kay Sievers
2009-07-07 19:34 ` 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=19026.16584.136177.940234@stoffel.org \
    --to=john@stoffel.org \
    --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).