Question & Answer
Question
How can I determine which drive serial number a given Linux mt device corresponds?
Answer
Most Linux distributions ship with or come with an easy way to install the 'sginfo' tool. This tool has a number of useful diagnostic tools such as a copy to device facility called sg_dd. But for serial number purposes it is able to send to the device the xinquiry command and return its results in full or in part. To get the serial number for example issue the command:
[root@TEST-MACHINE ~]# sginfo -s /dev/tsmscsi/mt1
Serial Number 'HU10734E54'
It is also easy to use the command in a script to list all serial numbers for each mt device on the system. ie.
[root@TEST-MACHIINE tsmscsi]# for each in /dev/tsmscsi/mt*; do echo $each $(sginfo -s $each); done 2> /dev/null | sort -n -k1.16 | grep Serial
/dev/tsmscsi/mt0 Serial Number 'HU10640L6B'
/dev/tsmscsi/mt1 Serial Number 'HU10734E54'
/dev/tsmscsi/mt2 Serial Number 'HU10640L5P'
/dev/tsmscsi/mt3 Serial Number 'HU10640L3M'
/dev/tsmscsi/mt4 Serial Number 'HU10735FY1'
/dev/tsmscsi/mt5 Serial Number 'HU10635LYK'
More info on sginfo can be found in the utilities man page.
[{"Product":{"code":"SSGSG7","label":"Tivoli Storage Manager"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Server","Platform":[{"code":"PF016","label":"Linux"}],"Version":"All Versions","Edition":"Edition Independent","Line of Business":{"code":"LOB26","label":"Storage"}}]
Product Synonym
TSM;ITSM;ADSM IBM Spectrum Protect
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21656776