Monitoring Hard Disks with smartctl , hddtemp and gsmartcontrol on CentOS December 14, 2010Posted by Tournas Dimitrios in Linux.
The smartmontools package contains two utility programs (smartctl and smartd) to control and monitor storage systems using the Self-Monitoring, Analysis and Reporting Technology System (SMART) built into most modern ATA and SCSI hard disks. In many cases, these utilities will provide advanced warning of disk degradation and failure. This package is a default utility for CentOs 5 , but if it’s not installed on your box , use yum to make an automatic installation . Use the smartctl command line utility to display many features of your installed data discs .
A GUI alternative to smartctl is GSmartControl . Unfortunately it is not provided by my favorite repositories , so I have to make the installation by hand , which I ‘ll demonstrate at the end of this article . Let’s first outline what options the smartctl provides to us .
First run the command : fdisk -l to get a clear ” picture ” what store devices are installed on your box . Now enable the smart function on the device of interest : smartctl -s /dev/hda
|SHOW INFORMATION OPTIONS Usage: smartctl [options] device|
|-h, –help, –usage||Display this help and exit|
|-V, –version, –copyright, –license||Print license, copyright, and version information and exit|
|-i, –info||Show identity information for device|
|-a, –all||Show all SMART information for device|
|SMARTCTL RUN-TIME BEHAVIOR OPTIONS (ATA)
|-q TYPE, –quietmode=TYPE||Set smartctl quiet mode to one of: errorsonly, silent|
|-d TYPE, –device=TYPE||Specify device type to one of: ata, scsi, marvell, 3ware,N|
|-T TYPE, –tolerance=TYPE||Tolerance: normal, conservative, permissive, verypermissive|
|-b TYPE, –badsum=TYPE||Set action on bad checksum to one of: warn, exit, ignore|
|-r TYPE, –report=TYPE||Report transactions (see man page)|
|READ AND DISPLAY DATA OPTIONS|
|-H, –health||Show device SMART health status|
|-c, –capabilities||Show device SMART capabilities|
|-A, –attributes||Show device SMART vendor-specific Attributes and values|
|-l TYPE, –log=TYPE||Show device log. TYPE: error, selftest, selective, directory|
|-v N,OPTION , –vendorattribute=N,OPTION||Set display OPTION for vendor Attribute N (see man page)|
|-F TYPE, –firmwarebug=TYPE||Use firmware bug workaround: none, samsung, samsung2|
|-P TYPE, –presets=TYPE||Drive-specific presets: use, ignore, show, showall|
|DEVICE SELF-TEST OPTIONS|
|-t TEST, –test=TEST||Run test. TEST is: offline short long conveyance select,M-N pending,N afterselect,on afterselect,off|
Do test in captive mode (along with -t)
|-X, –abort||Abort any non-captive test on device|
How to install the GUI alternative (GSmartControl )
This gui interface is provided as an rpm package , but it depends on 5 other package-libraries .
First download and install the libraries in the exacts order as they are displayed :
Download the packages via your browser or use the command line utility wget , and place them on a directory ( like /tmp ) . Use the usual way of installing rpm packages ( rpm -i xxxxx.rpm) . And now invoke the GUI via our command line : gsmartcontrol
A nice terminal utility to monitor the temperature of your hard drive is hddtemp . It can be downloaded with yum : yum install hddtemp ( EPEL repo) . To display the temp of your disc , just run : hddtemp /dev/hda