[ltp] Bad hard drive sector

Bill Sheppard linux-thinkpad@linux-thinkpad.org
Sun, 15 Jan 2006 19:07:12 -0800


Macskasi Csaba wrote:
> On Sun, 15 Jan 2006 19:16:14 +0100, Bill Sheppard
> <Bill.Sheppard@Sun.COM> wrote:
>> Not specifically Thinkpad related, but hopefully someone can help!
>>
>> I was doing a backup the other day and the computer hung on a given file
>> with the hard drive light constantly on.  A bit of sleuthing turned up
>> the following in syslog:
>>
>>     Jan 15 00:01:02 clonelptp kernel: hda: dma_intr: status=0x51 {
>>     DriveReady SeekComplete Error }
>>     Jan 15 00:01:02 clonelptp kernel: hda: dma_intr: error=0x40 {
>>     UncorrectableError  }, LBAsect=31051297, sector=31051287
>>     Jan 15 00:01:02 clonelptp kernel: ide: failed opcode was: unknown
>>
>> Turning off dma allowed the task to continue, although still receiving
>> an error code (and that file wasn't intact).  Running Smartmontools
>> (smartctl -t long /dev/hda) returned:
>>
>>     === START OF READ SMART DATA SECTION ===
>>     SMART Self-test log structure revision number 1
>>     Num  Test_Description    Status                  Remaining
>>     LifeTime(hours)  LBA_of_first_error
>>     # 1  Extended offline    Completed: read failure       00%
>>     1202         31051297
>>
>> So it appears there is a bad sector (or sectors on the hard drive).
>> It's a fairly new Toshiba MK6026GAX 60GB.  I understand the drives are
>> supposed to reallocate bad sectors automatically, but it appears it
>> isn't since the error persists.  Any ideas how I can correct this?
> Have you tried fsck? I think that it should mark the sector as bad and
> prevent it's usage...
> Hint: _DON'T_ try fsck on a mounted filesystem. Or you'll be another
> author of the unix horror storries. ;-)
> Format marks it also as "bad". (But I suppose that you don't want to
> reformat an existing system.)
I did reboot in single-user mode, remount / as ro, and ran fsck, which
came up fine.  Assuming the bad sector is in the middle of a file, which
I believe to be the case, fsck wouldn't find it, right, since it's only
checking that the directory structure itself is intact?  It's reiser if
that matters...

Bill

-- 
-------------------------------------------------------------------------
Bill Sheppard                                  Industry Marketing Manager
bill.sheppard@sun.com                   Consumer and Mobile Systems Group
(408) 404-1254 (x68154)                            Sun Microsystems, Inc.