How to check Health of a Hard drive

Under Linux, you can read the SMART (Self-Monitoring, Analysis and Reporting Technology) information from the hard disk using smartctl. The S.M.A.R.T [ Smartmontools] can be installed on your linux distribution using package available package manager.

In RHEL Based system :

# yum install smartmontools

In Ubuntu/Debian :

# apt-get install smartmontools

Once installation is completed , check whether your drive support SMART futures using the following command:-

# smartctl -i /dev/sdX 

[Replace “X” with your drive name , for example sda, sdb..]

In case SMART support is available, but for some reason is not activated, try the follwoing command to activate S.M.A.R.T

# smartctl -s on /dev/sda

To display the SMART attributes of the hard disk, perform the following command:

# smartctl -a /dev/sda

Important SMART Attributes

The following command will list some important parameters that may provide useful information

# smartctl -a /dev/sdX | egrep 'Reallocated_Sector_Ct|Spin_Retry_Count|Reallocated_Event_Count|Current_Pending_Sector|Offline_Uncorrectable'
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0

The following parameters may provide information concerning an impending hard drive failure.

Reallocated Sectors Count: Number of sectors that have been reallocated due to read errors (remapped).
Spin Retry Count: Number of attempts that have been required to bring the spindle to operating speed.
Reallocation Event Count: Number of remaps that have been carried out both (successful and unsuccessful).
Current Pending Sector Count: Number of sectors waiting for remapping.
Offline_Uncorrectable: Number of uncorrectable errors when accessing (read/write) to sectors.