Find the answer to your Linux question:
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 ...
  1. #1
    Linux 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!

  2. #2
    Linux Guru Rubberman's Avatar
    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!

  3. #3
    Linux 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...

  4. #4
    Linux Guru Rubberman's Avatar
    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!

  5. #5
    Linux Guru Rubberman's Avatar
    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
    Quote Originally Posted by galapogos View Post
    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...
    Good information. Thanks. I'll add those to my tool kit.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...