Few Tips Check Hard Disk Error and Health using smartctl

Checking the hard drive status of your pc is important. All the sensitive data is in your hard disk. In case of a hard disk failure, recovery is difficult and time consuming. Hard disks can have errors due to power failures and usage. Common errors include bad sectors or physical errors. Checking the hard disk status is not only for repairing the errors  but also for checking the hard disk health. If found in a bad condition, precautionary actions can be taken.

Self-Monitoring, Analysis and Reporting Technology (SMART)

SMART functionality is in-built in most ATA and SCSI hard disks. SMART disk drives internally monitor their own health and performance. The SMART disk itself provides advance warning when something is wrong and helps to avoid data loss or server crash.

The 'smartctl' utility and 'smartd' dæmon are the two utilities that are used to monitor the health of a system's disks and controllers. You can download these utilities from smartmontools.sourceforge.net

Check hard disk support SMART

Also, make sure SMART is supported and enabled in BIOS.

[[email protected] ]# smartctl -i /dev/hda
smartctl 5.39.1 2010-01-28 r3054 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF INFORMATION SECTION ===
Model Family: Western Digital
Device Model: WDC-WD2500BEVT-22ZCTO
Serial Number: 16D589D0
Firmware Version: 8.01
User Capacity: 239,315,447,808 bytes
Device is: In smartctl database [for details use: -P show] ATA Version is: 6
ATA Standard is: ATA/ATAPI-6 T13 1410D revision 2
Local Time is: Fri JULY 25 07:43:45 2012
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

Enable smartctl tool on a hard disk

[[email protected] ]# smartctl -s on /dev/hda
smartctl 5.39.1 2010-01-28 r3054 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF ENABLE/DISABLE COMMANDS SECTION ===

Or,

[[email protected] ]# # smartctl -s on -d ata /dev/sda

How to check hard disk health status

[[email protected] ]# smartctl –H /dev/hda
smartctl 5.39.1 2010-01-28 r3054 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

Or,

[[email protected] ]# smartctl -d ata -H /dev/sda

Or,

Check the disk’s health status, run disk self-tests, examine the disk’s self-test log (results of the last 21 self-tests) and examine the disk’s ATA error log (details of the last five disk errors):

[[email protected] ]#smartctl -q errorsonly -H -l selftest -l error /dev/hdc

If it fails then it might show error as shown below:

ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
190 Airflow_Temperature_Cel 0x0022 044 033 045 Old_age Always FAILING_NOW 56 (96 110 58 25)

Comand to get more info on hard disk

If it shows failure, you can try the command given below to get more info on hard disk:

[[email protected] ]# smartctl --attributes --log=selftest /dev/sda

Another option:

[[email protected] ]# smartctl -d ata -a /dev/sda

<h3?Short Test and Long Test

A long test might take all night.

[[email protected] ]# smartctl -t short /dev/sda

Run long test as shown below:

[[email protected] ]# smartctl -t long /dev/sda

Display the test result

[[email protected] ]# smartctl -l selftest /dev/sda

Or,

Displays the output for short and long tests:

[[email protected] ]# smartctl -d ata –attributes –log=selftest /dev/sda

About Bobbin Zachariah

Founder of LinOxide, passionate lover of Linux and technology writer. Started his career in Linux / Opensource from 2000. Love traveling, blogging and listening music. Reach Bobbin Zachariah about me page and google plus page.

Author Archive Page

Have anything to say?

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.