Saturday, August 18, 2012

Testing a Hard Disk

SKILLS -> Knowing your command line.

http://www.cyberciti.biz/tips/linux-find-out-if-harddisk-failing.html

This is the source article that I got the information from.  They do a great job of detailing the operation.  If the link is broken, here's the basic outline.

Install the software

apt-get install smartmontools -y

This basic command installs the smartmontools. You figured that didn't you :)

(sdx refers to one of the hard disks on your sytem.  sda,sdb,sdc,sdd)  If you don't know how to tell I would suggest using sda since that's the first in line.  If you have a second hard disk generally that's sdb.  That's generally of course.



(therefore smartctl -s on -d ata /dev/sda tests the first hard disk)





IS my harddisk smartcapable.  Usually it is but if you want to check:


smartctl -i /dev/hdx

[NOTE: If its not throw it out.  It's a junk hard disk ] 


This enables the function.


smartctl -s on -d ata /dev/sdx


Now we can read the error logs

smartctl -l error /dev/hdx

Send data to your email to yourself if you want.

/dev/sdx -m fred@myemail.com


The tests are more and more detailed but here are the basic command line structures.

 smartctl -d ata -H /dev/sdx
smartctl --attributes --log=selftest /dev/sdx
smartctl -d ata -a /dev/sdx

Short and Long tests for the hard disk

smartctl -d ata -t short /dev/sdx
smartctl -d ata -t long /dev/sdx

(output)
smartctl -a /dev/sdx

What's this?  Well if you want it all combined into a graphic interface, they use gsmartcontrol which is the graphic frontend.  
 
apt-get install gsmartcontrol

Have fun!
 






No comments:

Post a Comment