SCSI Hard Disk Number

Discussion in 'C++' started by Shonty, Jan 7, 2005.

  1. Shonty

    Shonty Guest

    Can any body know how to get the Hard Disk serial number of SCSI HDD.I
    will be very thankful to you if you give the code or Control code to
    get that.

    Thanks
    Shonty
     
    Shonty, Jan 7, 2005
    #1
    1. Advertising

  2. Shonty

    SnaiL Guest

    Generally it depends on operating system. I know how you can do it with
    Linux:

    #include <stdio.h>
    #include <fcntl.h>
    #include <linux/hdreg.h>

    int main()
    {
    struct hd_driveid hd;
    int ide;
    ide=open("/dev/hda",O_RDONLY);
    (void)ioctl(ide,HDIO_GET_IDENTITY,&hd);
    (void)printf("Serial number - %s\n",hd.serial_no);
    return (0);
    }

    P.S.: this code is sample only, profesional program will contain error
    checking and some more .. :)
     
    SnaiL, Jan 7, 2005
    #2
    1. Advertising

  3. Shonty

    Shonty Guest

    SnaiL wrote:
    > Generally it depends on operating system. I know how you can do it

    with
    > Linux:
    >
    > #include <stdio.h>
    > #include <fcntl.h>
    > #include <linux/hdreg.h>
    >
    > int main()
    > {
    > struct hd_driveid hd;
    > int ide;
    > ide=open("/dev/hda",O_RDONLY);
    > (void)ioctl(ide,HDIO_GET_IDENTITY,&hd);
    > (void)printf("Serial number - %s\n",hd.serial_no);
    > return (0);
    > }
    >
    > P.S.: this code is sample only, profesional program will contain

    error
    > checking and some more .. :)



    hi Snail,
    thanks for your responce , i will try it and then can give my remark on
    that.
    Thanks,
     
    Shonty, Jan 7, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dennis Garcia

    FPGA SCSI controller

    Dennis Garcia, Jan 17, 2005, in forum: VHDL
    Replies:
    0
    Views:
    1,176
    Dennis Garcia
    Jan 17, 2005
  2. Ahmed Essa

    hard disk serial number

    Ahmed Essa, Nov 17, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    526
    Nick Hertl
    Nov 17, 2005
  3. Charles P Lamb

    SCSI, tape, and scanner I/O?

    Charles P Lamb, Jul 26, 2005, in forum: Java
    Replies:
    0
    Views:
    463
    Charles P Lamb
    Jul 26, 2005
  4. MRAB
    Replies:
    3
    Views:
    1,155
    Paul Boddie
    Jun 4, 2009
  5. Ahmed Essa

    help plz hard disk serial number

    Ahmed Essa, Nov 17, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    145
    Ahmed Essa
    Nov 17, 2005
Loading...

Share This Page