Thread: getting model an serial information from SAS harddisk

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2014
    Posts
    18

    getting model an serial information from SAS harddisk

    platform: linux

    I am writing a little program which requires to get the serial and model information out of harddisks. (SAS, FC, SATA etc)

    for SATA it is very easy with an ioctl command (HDIO_GET_IDENTITY) which is defined in <linux/hdreg.h>.

    However this doesnt work on SAS and FC drives. So I thought to myself they are SCSI based and thus a SCSI inquiry would work. So I write a neat little function which sends and inquiry for me and retrieves the output.

    Now I get gibberish as the output from the inquiry(it doesnt 'fail' though). the drives are attached to a pci-e SAS card.
    I suspect the SAS card does something odd as I have tried to use my program on a virtual machine with virtual SAS drives and that seems to work...

    Also the SATA drives are hooked up to the same pci-e card (SAS offers backwards compatibility with SATA)

    is there another way to get serial and model information out of a harddisk besides the ways I have done?

    regards
    Last edited by thomas23; 02-15-2014 at 11:49 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to get Memory Address of a File in HardDisk
    By zacless in forum C Programming
    Replies: 1
    Last Post: 09-12-2013, 11:13 PM
  2. Replies: 3
    Last Post: 04-08-2011, 06:26 AM
  3. Send and Recive Information through the serial Port RS232
    By amigoloko in forum C# Programming
    Replies: 4
    Last Post: 04-14-2006, 12:34 PM
  4. Looking for a file in the HardDisk
    By BianConiglio in forum C Programming
    Replies: 11
    Last Post: 03-15-2004, 12:52 PM
  5. Speed of Harddisk
    By Kelvin in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 07-16-2002, 04:45 PM