Results 1 to 4 of 4

Thread: reading hard disk number

  1. #1
    Join Date
    Feb 2009
    Location
    chennai, India
    Beans
    75
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    reading hard disk number

    Can anyone tell me how to read the Hard Disk Serial Number as well as the volume number....

  2. #2
    Join Date
    Mar 2008
    Beans
    4,715
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: reading hard disk number

    Code:
    udevadm info -a -p /sys/block/sdb | grep serial
    yields
    Code:
        ATTRS{serial}=="2GEVLJDW"
        ATTRS{serial}=="0000:00:1a.7"
    thus showing the serial number of the second hard drive, /dev/sdb.

    You can also find this information by parsing the output of
    Code:
    sudo lshw -C disk
    I don't know what you mean by volume number.

  3. #3
    Join Date
    Aug 2007
    Beans
    949

    Re: reading hard disk number

    Maybe he means the logical volume number, if he's using LVM. Unfortunately I don't know how to get this.

  4. #4
    Join Date
    Feb 2009
    Location
    chennai, India
    Beans
    75
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: reading hard disk number

    Quote Originally Posted by unutbu View Post
    Code:
    udevadm info -a -p /sys/block/sdb | grep serial
    yields
    Code:
        ATTRS{serial}=="2GEVLJDW"
        ATTRS{serial}=="0000:00:1a.7"
    thus showing the serial number of the second hard drive, /dev/sdb.

    You can also find this information by parsing the output of
    Code:
    sudo lshw -C disk
    I don't know what you mean by volume number.
    Thanks... This command was helpful....

    Now, I am planning to write a C program to read the hard disk serial number. I dont have any idea of from where to start with.

    Can anyone help me on this...

Bookmarks

Posting Permissions

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