Test If Linux Server Hard Disk Going Bad

Back

I/O errors in /var/log/messages indicates that something is wrong with the hard disk and it may be failing. You can check hard disk for errors using smartctl command, which is control and monitor utility for SMART disks under Linux / UNIX like operating systems.

First we need to install the right packages

On Debian or Ubuntu systems:

# sudo apt-get install smartmontools

On Fedora:

# sudo yum install smartmontools


To enable SMART, run:

# smartctl -s on -d ata /dev/sda


Now we can run the test

# smartctl -d ata -H /dev/sda


Sample output of good drive:

smartctl version 5.33 [x86_64-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen Home page is http://smartmontools.sourceforge.net/ === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED

If drive is falling, this is the output:


smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
Please note the following marginal Attributes:
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)
 
 

A note about 3ware RAID controllers

To look at ATA disks behind 3ware SCSI RAID controllers, the syntax is:

# smartctl -a -d 3ware,2 /dev/sda
# smartctl -a -d 3ware,0 /dev/twe0


If you're experiencing bad hard drive, please submit trouble ticket and we will replace it. Don't forget to report the Serial Number of broken disk. For example, if bad drive is sda, run:

# smartctl -i /dev/sda| grep Serial


If broken hdd is not visible in the system, please include in the ticket, the Serial Number of good disk.

 

 


 




Was this article helpful?
Dislike0 Like0

Views: 1434