How to GET HardDisk's serial number? - Linux

This is a discussion on How to GET HardDisk's serial number? - Linux ; My progam work on redhat linux 9.0, and I want to get the HardDisk SN. How can I do it? Thanks -- zhengfis ----------------------------------------------------------------------- zhengfish's Profile: http://usenetlinux.com/member.php?userid=138 View this thread: http://usenetlinux.com/showthread.php?t=41423...

+ Reply to Thread
Results 1 to 13 of 13

Thread: How to GET HardDisk's serial number?

  1. How to GET HardDisk's serial number?



    My progam work on redhat linux 9.0, and I want to get the HardDisk SN.
    How can I do it?
    Thanks

    --
    zhengfis
    -----------------------------------------------------------------------
    zhengfish's Profile: http://usenetlinux.com/member.php?userid=138
    View this thread: http://usenetlinux.com/showthread.php?t=41423


  2. Re: How to GET HardDisk's serial number?

    zhengfish wrote:
    >
    > My progam work on redhat linux 9.0, and I want to get the HardDisk SN.
    > How can I do it?
    > Thanks!
    >

    Try:
    smartctrl -a

  3. Re: How to GET HardDisk's serial number?


    > nobody said in post '#2 ' (http://tinyurl.com/7v5xt):
    > ...
    > Try:
    > smartctrl -a
    >


    after that errors out, try *#smartctl -a * instead!


    ~

    -
    kr0m3 - supervillia

    When the power of love overcomes the love of power the world will kno
    peace.
    Jimi Hendrix (1942-1970)

    -----------------------------------------------------------------------
    kr0m3's Profile: http:/linuxcult.com/forum/member.php?action=getinfo&userid=136
    View this thread: http://linuxcult.com/forum/showthread.php?threadid=911


  4. Re: How to GET HardDisk's serial number?

    kr0m3 wrote:

    >
    >> nobody said in post '#2 ' (http://tinyurl.com/7v5xt):
    >> ...
    >> Try:
    >> smartctrl -a
    >>

    >
    > after that errors out, try *#smartctl -a * instead!
    >
    >
    > ~k
    >
    >
    > --
    > kr0m3 - supervillian
    >
    > When the power of love overcomes the love of power the world will know
    > peace.
    > Jimi Hendrix (1942-1970)
    >
    > ------------------------------------------------------------------------
    > kr0m3's Profile:
    > http:/linuxcult.com/forum/member.php?action=getinfo&userid=1361 View this
    > thread: http://linuxcult.com/forum/showthread.php?threadid=9112


    ----------------------

    And after you stumble around trying to find the correct combination for the
    command, this is the way to do it:


    [root@localhost dave]# smartctl -a /dev/hdb

    smartctl version 5.33 [i386-redhat-linux-gnu] Copyright (C) 2002-4 Bruce
    Allen
    Home page is http://smartmontools.sourceforge.net/

    === START OF INFORMATION SECTION ===
    Device Model: SAMSUNG SP1604N
    Serial Number: S013J20Y143611
    Firmware Version: TM100-30
    User Capacity: 160,041,885,696 bytes
    Device is: In smartctl database [for details use: -P show]
    ATA Version is: 7
    ATA Standard is: ATA/ATAPI-7 T13 1532D revision 0
    Local Time is: Wed May 18 08:06:50 2005 CDT
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled

    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED

    General SMART Values:
    Offline data collection status: (0x00) Offline data collection activity
    was never started.
    Auto Offline Data Collection:
    Disabled.
    Self-test execution status: ( 0) The previous self-test routine
    completed
    without error or no self-test has
    ever
    been run.
    Total time to complete Offline
    data collection: (6000) seconds.
    Offline data collection
    capabilities: (0x1b) SMART execute Offline immediate.
    Auto Offline data collection on/off
    supp
    ort.
    Suspend Offline collection upon new
    command.
    Offline surface scan supported.
    Self-test supported.
    No Conveyance Self-test supported.
    No Selective Self-test supported.
    SMART capabilities: (0x0003) Saves SMART data before entering
    power-saving mode.
    Supports SMART auto save timer.
    Error logging capability: (0x01) Error logging supported.
    No General Purpose Logging support.
    Short self-test routine
    recommended polling time: ( 1) minutes.
    Extended self-test routine
    recommended polling time: ( 100) minutes.

    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED
    WHEN_
    FAILED RAW_VALUE
    1 Raw_Read_Error_Rate 0x000f 100 100 051 Pre-fail Always
    -
    0
    3 Spin_Up_Time 0x0007 100 100 025 Pre-fail Always
    -
    4160
    4 Start_Stop_Count 0x0032 100 100 000 Old_age Always
    -
    118
    5 Reallocated_Sector_Ct 0x0033 100 100 011 Pre-fail Always
    -
    0
    7 Seek_Error_Rate 0x000f 100 100 051 Pre-fail Always
    -
    0
    8 Seek_Time_Performance 0x0025 100 100 015 Pre-fail Offline
    -
    0
    9 Power_On_Half_Minutes 0x0032 100 100 000 Old_age Always
    -
    725h+07m
    10 Spin_Retry_Count 0x0033 100 100 051 Pre-fail Always
    -
    0
    11 Calibration_Retry_Count 0x0012 100 100 000 Old_age Always
    -
    0
    12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always
    -
    76
    194 Temperature_Celsius 0x0022 085 058 000 Old_age Always
    -
    51
    195 Hardware_ECC_Recovered 0x001a 100 100 000 Old_age Always
    -
    5814727
    196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always
    -
    0
    197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always
    -
    0
    198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline
    -
    0
    199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always
    -
    6
    200 Multi_Zone_Error_Rate 0x000a 100 100 051 Old_age Always
    -
    0
    201 Soft_Read_Error_Rate 0x000a 100 100 051 Old_age Always
    -
    0

    SMART Error Log Version: 1
    ATA Error Count: 2
    CR = Command Register [HEX]
    FR = Features Register [HEX]
    SC = Sector Count Register [HEX]
    SN = Sector Number Register [HEX]
    CL = Cylinder Low Register [HEX]
    CH = Cylinder High Register [HEX]
    DH = Device/Head Register [HEX]
    DC = Device Command Register [HEX]
    ER = Error register [HEX]
    ST = Status register [HEX]
    Powered_Up_Time is measured from power on, and printed as
    DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
    SS=sec, and sss=millisec. It "wraps" after 49.710 days.

    Error 2 occurred at disk power-on lifetime: 462 hours (19 days + 6 hours)
    When the command that caused the error occurred, the device was active or
    idle
    ..

    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    -- -- -- -- -- -- --
    04 51 00 01 4f c2 b0 Error: ABRT

    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    -- -- -- -- -- -- -- -- ---------------- --------------------
    b0 d9 00 01 4f c2 b0 00 00:15:26.250 SMART DISABLE OPERATIONS
    ec 00 3f 01 00 00 b0 00 00:15:26.250 IDENTIFY DEVICE
    10 00 3f 01 4f c2 b0 00 00:15:26.250 RECALIBRATE [OBS-4]
    91 00 3f 01 4f c2 bf 00 00:15:26.250 INITIALIZE DEVICE PARAMETERS
    [OBS-6
    ]
    ec 00 3f 01 00 00 b0 00 00:15:26.063 IDENTIFY DEVICE

    Error 1 occurred at disk power-on lifetime: 45 hours (1 days + 21 hours)
    When the command that caused the error occurred, the device was active or
    idle.

    After command completion occurred, registers were:
    ER ST SC SN CL CH DH
    -- -- -- -- -- -- --
    04 51 00 01 4f c2 b0 Error: ABRT

    Commands leading to the command that caused the error were:
    CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
    -- -- -- -- -- -- -- -- ---------------- --------------------
    b0 d9 00 01 4f c2 b0 00 00:00:08.938 SMART DISABLE OPERATIONS
    ec 00 3f 01 00 00 b0 00 00:00:08.938 IDENTIFY DEVICE
    10 00 3f 01 4f c2 b0 00 00:00:08.938 RECALIBRATE [OBS-4]
    91 00 3f 01 4f c2 bf 00 00:00:08.938 INITIALIZE DEVICE PARAMETERS
    [OBS-6]
    ec 00 3f 01 00 00 b0 00 00:00:08.625 IDENTIFY DEVICE

    SMART Self-test log structure revision number 1
    No self-tests have been logged. [To run self-tests, use: smartctl -t]
    Device does not support Selective Self Tests/Logging

    [root@localhost dave]#

    Hope this helps ...

    Dave





  5. Re: How to GET HardDisk's serial number?


    "stumble around", dave? next time you could actually try being helpful
    let alone correct.

    forget what dave said above, zhengfish. /dev/hdb is correc
    alright...IF that happens to be the drive you want to check the seria
    # on. since that is the ID of a typical SECOND hard-drive on any give
    system, you may want to verify your settings before following an
    presumptious (and erroneous) advice.

    i might recommend that you run a command like "mount" (assuming it ha
    been) and let it tell you your device location if you have an
    questions...oh...and note that in that 40-page post above that all yo
    are really looking for is the second line of output. as far as you
    original question is concerned, the rest of that post is irrelevant.


    ...."stumble around..." heh heh heh

    ~

    -
    kr0m3 - supervillia

    When the power of love overcomes the love of power the world will kno
    peace.
    Jimi Hendrix (1942-1970)

    -----------------------------------------------------------------------
    kr0m3's Profile: http:/linuxcult.com/forum/member.php?action=getinfo&userid=136
    View this thread: http://linuxcult.com/forum/showthread.php?threadid=911


  6. Re: How to GET HardDisk's serial number?

    CWO4 Dave Mann wrote in
    news:1651944.dvZjf8txce@linux.user.and.happy:

    > [root@localhost dave]#


    That sure worked. Hey Dave, how come I have a tilde in my prompt and you
    don't?

    [root@ohmster ~]#

    Running FC3. Did not have a tilde with redhat 9. Thanks.

    --
    ~Ohmster
    ohmster at newsguy dot com

  7. Re: How to GET HardDisk's serial number?

    * Ohmster Wrote in comp.os.linux:

    > CWO4 Dave Mann wrote in
    > news:1651944.dvZjf8txce@linux.user.and.happy:
    >
    >> [root@localhost dave]#

    >
    > That sure worked. Hey Dave, how come I have a tilde in my prompt
    > and you don't?
    >
    > [root@ohmster ~]#
    >
    > Running FC3. Did not have a tilde with redhat 9. Thanks.
    >


    I beleive that has something to do with the bash_completion package.
    I was playing around with it the other day and my prompt changed to

    [root@gates_of_hell sinner]#

    When I logged out completely and back in, all was normal again, ie I
    had the ~ instead of sinner.

    --
    David

  8. Re: How to GET HardDisk's serial number?

    On Thu, 19 May 2005 at 12:49 GMT, Ohmster wrote:
    > CWO4 Dave Mann wrote in
    > news:1651944.dvZjf8txce@linux.user.and.happy:
    >
    >> [root@localhost dave]#

    >
    > That sure worked. Hey Dave, how come I have a tilde in my prompt and you
    > don't?


    Your prompt can be whatever you want it to be; you define it by
    setting the PS1 variable.

    The tilde represents your home directory and is included in PS1 by
    using \w to represent the current directory:

    $ PS1='\w \$ '
    ~ $ cd /usr/bin
    /usr/bin $ cd

    I prefer to have the path spelled out:

    ~ $ PS1='$PWD \$ '
    /home/chris $

    There are several escape sequences you can include in PS1; you can
    also include variables, and code to be executed:

    /home/chris $ PS1='$(date) \$ '
    Thu May 19 13:09:54 EDT 2005 $

    See the PROMPTING section in the bash man pages for more.

    > [root@ohmster ~]#
    >
    > Running FC3. Did not have a tilde with redhat 9. Thanks.
    >



    --
    Chris F.A. Johnson
    ================================================== ================
    Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress


  9. Re: How to GET HardDisk's serial number?

    Chris F.A. Johnson wrote:

    > On Thu, 19 May 2005 at 12:49 GMT, Ohmster wrote:
    >> CWO4 Dave Mann wrote in
    >> news:1651944.dvZjf8txce@linux.user.and.happy:
    >>
    >>> [root@localhost dave]#

    >>
    >> That sure worked. Hey Dave, how come I have a tilde in my prompt and you
    >> don't?

    >
    > Your prompt can be whatever you want it to be; you define it by
    > setting the PS1 variable.
    >
    > The tilde represents your home directory and is included in PS1 by
    > using \w to represent the current directory:
    >
    > $ PS1='\w \$ '
    > ~ $ cd /usr/bin
    > /usr/bin $ cd
    >
    > I prefer to have the path spelled out:
    >
    > ~ $ PS1='$PWD \$ '
    > /home/chris $
    >
    > There are several escape sequences you can include in PS1; you can
    > also include variables, and code to be executed:
    >
    > /home/chris $ PS1='$(date) \$ '
    > Thu May 19 13:09:54 EDT 2005 $
    >
    > See the PROMPTING section in the bash man pages for more.
    >
    >> [root@ohmster ~]#
    >>
    >> Running FC3. Did not have a tilde with redhat 9. Thanks.
    >>


    For those of us who grew up with the blinking prompt ">", remember all those
    cool sequences we could put into the autoexec.bat file to make the cursor
    talk back at us? Let's see, $p$g$%x

    Or something like that.

    I think we could do that all the way back to CP/M but that has been a few
    years ago now and the steady diet of twinkies, RC Cola and three continuous
    hours of reading the

    alt.binaries.pictures.oh.my.god.how.can.she.do.tha t.and.not.die.eewwwww

    threads have taken their toll on my former JCL and Pascal programmers brain
    cells.


    $p${a}$~! (Happy face blinking cursor, I think.

    Cheers,

    Dave





    >


    --
    -----------------

    Study History - Know the Future

    http://misterfixit.blogspot.com
    http://daves928.blogspot.com
    http://carondelet.blogspot.com





  10. Re: How to GET HardDisk's serial number?

    SINNER wrote:

    > * Ohmster Wrote in comp.os.linux:
    >
    >> CWO4 Dave Mann wrote in
    >> news:1651944.dvZjf8txce@linux.user.and.happy:
    >>
    >>> [root@localhost dave]#

    >>
    >> That sure worked. Hey Dave, how come I have a tilde in my prompt
    >> and you don't?
    >>
    >> [root@ohmster ~]#
    >>
    >> Running FC3. Did not have a tilde with redhat 9. Thanks.
    >>

    >
    > I beleive that has something to do with the bash_completion package.
    > I was playing around with it the other day and my prompt changed to
    >
    > [root@gates_of_hell sinner]#
    >
    > When I logged out completely and back in, all was normal again, ie I
    > had the ~ instead of sinner.
    >


    Just be glad that you didn't receive the "Fatal Error 666" message.
    (Otherwise known as the "Honey, please call the Priest NOW!" message.

    Cheers,

    Dave

    -----------------

    Study History - Know the Future

    http://misterfixit.blogspot.com
    http://daves928.blogspot.com
    http://carondelet.blogspot.com





  11. Re: How to GET HardDisk's serial number?

    "Chris F.A. Johnson" wrote in news:8vtul2-ue4.ln1
    @rogers.com:

    > See the PROMPTING section in the bash man pages for more.


    Excellent, thanks Chris.

    --
    ~Ohmster
    ohmster at newsguy dot com

  12. Re: How to GET HardDisk's serial number?

    CWO4 Dave Mann wrote in
    news:3494453.DepP6VJP8O@linux.user.and.happy:

    > Just be glad that you didn't receive the "Fatal Error 666" message.
    > (Otherwise known as the "Honey, please call the Priest NOW!" message.
    >
    > Cheers,
    >
    > Dave


    Yah, or even the devil head appears as a prompt like Dave's Xface. LOL!

    ....at least my Xface is my real picture. Handsome devil, wouldn't ya say?
    ;>P

    --
    ~Ohmster
    ohmster at newsguy dot com

  13. Re: How to GET HardDisk's serial number?

    * Ohmster wrote in comp.os.linux:
    > CWO4 Dave Mann wrote in
    > news:3494453.DepP6VJP8O@linux.user.and.happy:


    >> Just be glad that you didn't receive the "Fatal Error 666" message.
    >> (Otherwise known as the "Honey, please call the Priest NOW!" message.


    >> Cheers,


    >> Dave


    > Yah, or even the devil head appears as a prompt like Dave's Xface. LOL!


    > ...at least my Xface is my real picture. Handsome devil, wouldn't ya say?
    > ;>P



    ROTFL!

    --
    David
    It is a wise father that knows his own child.
    -- William Shakespeare, "The Merchant of Venice"

+ Reply to Thread