View Single Post
Old 21st September 2012
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Just use

# smartctl -t short /dev/wd0c

It will run what is called an "offline" test -- the electronics on the drive will conduct a self test. It is "offline" because normal operations may continue (though they may extend the time of the test). The output from smartctl will tell you how much time it will take if the drive doesn't get any I/O requests. Short tests of the electronics should just be 1-3 minutes or so.

After this test completes, the output from smartctl -a will show you whether it was successful or not.

Then, a media test is the long "offline" test. Your OS can continue to run. The drive electronics will read every sector of the drive for you.

# smartctl -t long /dev/wd0c

When this completes, another -a can be run. You'll know, at this point, whether the drive electronics or the media is the problem. If there were no errors, the problem is either the cable or the controller on the motherboard.

If there were media errors, the badblocks program can be used to force the drive electronics to replace bad sectors with spare sectors. It writes patterns to all (or a range of) sectors, reads them back, and writes a different pattern, repeating the cycle, in an attempt to force both errors to occur and sector replacement to occur.
Reply With Quote