Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What's the best way to check for HDD errors and early signs of failure on CentOS?

share|improve this question
how frequent should the checks be? daily - weekly? – inac Jun 12 '10 at 4:19
up vote 2 down vote accepted

I would recommend installing smartmon ( to your machine this is some software which can check the health of your disks otherwise its going to be checking /var/log/messages or /var/log/syslog for any mentions of scsi errors

share|improve this answer
smartmon seems it, although its stats mention it'd catch only 60% of failing drives.. if i set smartmon to scan daily, would this actually help the hdd die faster -- it's a seagate 7200.10? – inac Jun 12 '10 at 4:18
@inac smartmon will help hdds to die faster? Where did you read this? Please add an URL. – 030 Feb 26 '15 at 12:19

You can run fsck on the device to check for errors.

share|improve this answer

The kernel will log any diagnostic messages about I/O devices, so you can check those messages out with the dmesg command.

share|improve this answer
but you'd have to run this manually or cronjob dmesg dump to vi? – inac Jun 12 '10 at 4:17
either. you could create a script to dump it with "dmesg > dmesg.dump.txt" and run that daily with cron. – Banjer Jun 14 '10 at 19:25

As Paul says, the SMART logs are a good place to check.

I'd also recommend running BadBlocks. If you've got a RAID card, you might have to use the monitoring on that.

share|improve this answer

SMART monitoring is a good way. As root, smartctl -a /dev/hda, where hda is the drive you want... could be hdb, sda, etc. Also recommend setting your email address in /etc/aliases as the person who should get root's mail.

That's a very vague answer though. If you have a server made by any of the big manufacturers (Dell, HP, etc), chances are there are better monitoring capabilities available.

share|improve this answer

You can try full check of partition /dev/sda1 (for example) as

fsck -f /dev/sda1

or, try full write-read non-descructive test of given partition

badblocks -vn /dev/sda1
share|improve this answer
/dev/sda1 is mounted; it's not safe to run badblocks! – 030 Feb 26 '15 at 11:58
e2fsck: Cannot continue, aborting. – 030 Feb 26 '15 at 11:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.