Re: howto get serial number of a tape drive?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Kay> On Mon, Jul 6, 2009 at 17:58, John Stoffel<john@xxxxxxxxxxx> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux