StoreEver Tape Storage
1753502 Members
4973 Online
108794 Solutions
New Discussion

Determine tape drive serial number, RHEL. (from cli for script purposes)

 
SOLVED
Go to solution
Adam Garsha
Valued Contributor

Determine tape drive serial number, RHEL. (from cli for script purposes)

Does anyone know a way to grok a scsi_tape drive serial number from a linux shell? I've looked around in /sys/class/scsi_tape, etc. and I don't see it anywhere. scsi_id seems to work only with drives? Wondering how I can get that information.

 

Dataprotector's "devbra --list_devices" is able to poll/show the info, but I am wondering if there is a core linux command or trick or standard linux tool that I can use to figure it out (should I not have DP installed on a given node).

 

Much thanks.

2 REPLIES 2
Torsten.
Acclaimed Contributor

Re: Determine tape drive serial number, RHEL. (from cli for script purposes)

I'm not really sure about such "native" command.

 

But if you have a HP tape drive, you should have HP library and tape tools (LTT) too.

 

You can use this tool from CLI, example:

 

 

Example

hp_ltt -f scan

This command produces the following output in a file named saved_scan.txt in the current folder:

2/0.4.0:HP:Ultrium 3-SCSI:G54D

From this output, the device hardware path is:

2/0.4.0

For each device L&TT finds during the scan there will be a corresponding entry in this file

 

 

You can review the help file, get the options you really need and after running the tool grep for your values or just pipe the results to your script.


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Adam Garsha
Valued Contributor
Solution

Re: Determine tape drive serial number, RHEL. (from cli for script purposes)

Looks like scsi_id is what I was looking for. Sadly, it doesn't seem to work with my older EML 103e, with the LTO3 drives, but works fine with LTO4 drives:

 

scsi_id -a -p 0x80 -g -s /class/scsi_tape/nst2

SHP     Ultrium 4-SCSI HU10139JF1

 

I'll see if I can figure out what the deal is with the other library's drives. They aren't THAT old, wondering if since they are in use currently they aren't giving up the goods.

 

The scsi_id command will send an INQUIRY to the scsi device. I found these links interesting and they solved half my problem:

 

http://www.backupcentral.com/phpBB2/two-way-mirrors-of-external-mailing-lists-3/emc-networker-19/persistent-binding-in-linux-96923/

http://docs.oracle.com/cd/E21429_01/en/CRCM2526/CRCM2526.pdf (page 50-ish)