Results 1 to 5 of 5
Hi,
I'm trying to get the serial number of a storage device. I've tried sg3_utils and sg_inq does this. I tried calling the functions within the sg3 source files, but ...
- 06-08-2009 #1Linux Newbie
- Join Date
- Apr 2008
- Posts
- 110
SCSI inquiry to get storage device serial number
Hi,
I'm trying to get the serial number of a storage device. I've tried sg3_utils and sg_inq does this. I tried calling the functions within the sg3 source files, but I can't seem to build it even after including the relevant header files.
I've also tried forming my own SCSI inquiry CDB and sending it to the device, but I only seem to get the vendor ID and product ID, no serial number and other information.
Does anyone know how to use the functions within sg3_utils, or how to obtain the serial number?
Thanks!
- 06-09-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
I looked in /proc/scsi and the only serial number I found was for my USB drive. None of the sata or ata drives showed any serial number information, though /proc/scsi/scsi shows all the channel, id, lun, make, model, and such - but no serial number.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 06-09-2009 #3Linux Newbie
- Join Date
- Apr 2008
- Posts
- 110
If you get sg3_utils and use sg_inq you'd see the serial number. Anyway I figured it out. Just had to issue a SCSI INQUIRY command with different parameters...
- 06-09-2009 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
FWIW, I have been able to get serial numbers using Seagate's Seatools utility program.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 06-09-2009 #5


Reply With Quote
