[SATLUG] Using the Data Recovery and HD maintenance tools

herb cee hc at lookcee.com
Mon Jun 16 10:39:41 CDT 2008

*** HD, maint & recovery
Whew, thanks guys for the recent discussion on HD failure. I do know 
from a foot high stack of broke HDs that all HDs will fail at some 
future moment. I do not use A/C so all my equipment runs hot. I do try 
to stay backed up to a separate unit on my LAN but at times I could lose 
a month of generated data and changes. (BTW inside every HD is one or 
two of the strongest magnets in the world.)

I now am trying to understand how to use the tools mentioned in the 
recent 'Data Recovery help!' thread, I would very much appreciate any 
help and pointers you may think of passing on. Below is good as I can do 
in portraying where I currently sit.

Special thanks to Robert P, great job of digging ...
**[Prevention Tools]
smartctl is part of the smartmontools package
"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 harddisks. In many cases, these
utilities will provide advanced warning of disk degradation and
The key phrase is "provide advanced warning".
An ounce of prevention is worth a pound of cure...

The SATLUG email show several references to using Google and the
search string "xcssa smartctl" to view examples of using smartctl. I
was unable to find anything with that Google search string other than
email references. XCSSA is at:
(X-otic Computer Systems of San Antonio) Lots of good information.

*** Can someone familar with Ubuntu-Gnome please tell me how I can use 
this tool to know when I should think of replacing my HDs?
So far I opened Synaptic PM and installed the smartmontools package and 
TestDisk, hdparm was already installed.

I ran the command Tweeks suggested but it returned 'smart' not on. I 
read the man pages for smartctl, (I had this silly urge to print it out 
and go to my grove of Oaks and read it to them)

I read: * LINUX: Use the forms "/dev/hd[a-t]" for IDE/ATA devices ....
-s VALUE, --smart=VALUE
Enables or disables SMART on device. The valid arguments to
this option are on and off. Note that the command ´-s on´
(perhaps used with with the ´-o on´ and ´-S on´ options) should
be placed in a start-up script for your machine, for example in
rc.local or rc.sysinit. In principle the SMART feature settings
are preserved over power-cycling, but it doesn´t hurt to be

smartctl -a /dev/hda
Print all SMART information for drive /dev/hda (Primary Master).

smartctl -s off /dev/hdd
Disable SMART on drive /dev/hdd (Secondary Slave).

smartctl --smart=on --offlineauto=on --saveauto=on /dev/hda
Enable SMART on drive /dev/hda, enable automatic offline testing every
four hours, and enable autosaving of SMART Attributes. This is a good
start-up line for your system´s init files. You can issue this command
on a running system.

* I tried to turn smart 'on' .. here are the results ...
herb at Celf:~$ sudo smartctl --smart=on --offlineauto=on --saveauto=on 
[sudo] password for herb:
smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
*Smartctl open device: /dev/hda failed: No such file or directory
herb at Celf:~$

I don't have a clue how to use the CLI it just plain scares me since I 
am aware that I dunno what I am doing! Can you tell me what I did wrong 
in the command string above please? Once I get 'smart' turned ON what 
should I run to test the drive?*

Here are the other examples in the Man:

smartctl -t long /dev/hdc
Begin an extended self-test of drive /dev/hdc. You can issue this com-
mand on a running system. The results can be seen in the self-test log
visible with the ´-l selftest´ option after it has completed.

smartctl -s on -t offline /dev/hda
Enable SMART on the disk, and begin an immediate offline test of drive
/dev/hda. You can issue this command on a running system. The results
are only used to update the SMART Attributes, visible with the ´-A´
option. If any device errors occur, they are logged to the SMART error
log, which can be seen with the ´-l error´ option.

smartctl -A -v 9,minutes /dev/hda
Shows the vendor Attributes, when the disk stores its power-on time
internally in minutes rather than hours.

smartctl -q errorsonly -H -l selftest /dev/hda
Produces output only if the device returns failing SMART status, or if
some of the logged self-tests ended with errors.

smartctl -q silent -a /dev/hda
Examine all SMART data for device /dev/hda, but produce no printed out-
put. You must use the exit status (the $? shell variable) to learn if
any Attributes are out of bound, if the SMART status is failing, if
there are errors recorded in the self-test log, or if there are errors
recorded in the disk error log.

Thanks gang

More information about the SATLUG mailing list