[ale] fsck and bad block check?

Bob's ALE Mail transam at cavu.com
Wed Dec 6 16:19:13 EST 2000


> I appear to have a failing laptop drive in my wife's box.  Little 4gigger
> in a p200.  I love comparing it against the p2-400's running NT as it
> keeps up well, some it out performs.

FSCK will not mark those blocks as bad.

Sometimes blocks will be bad after a single write and rewriting them
will recover.

One solution would be to do the following as root:

script /tmp/bad.log
find / -print -exec cp '{}' /dev/null \;
exit

The cp program should spit out an error on each file that has bad blocks
in it.  If it doesn't you can instead invoke a script that uses the dd
program.

Then, it is important to overwrite the bad blocks until they read correctly.
You don't simply want to do "cp somefile badfile" because cp's initial
creat() call will put those blocks on the free list.  You need to write
a program that instead does an open(), then seeks to the beginning of the
file, and overwrites the _existing_ blocks.  (I do include such a program
on the CD-ROM that comes with the book but any C programmer can write it
in 10 minutes.)

It's best not to remove or truncate the file because that would put these
flakey blocks back on the free list.  I'm not sure offhand how to actually
mark the blocks as bad but it's certainly in the doc.

This might solve the problem, especially if the bad blocks were written
when the laptop was in an unusual environment such as one especially
cold or hot or in vibration or in an unusual angle.

> At anyrate, I appear to have some bad blocks if not a dieing drive.  Any
> chance I can do a bad block check with fsck?  

> Anyone have a 4Gig or so laptop drive that'll go cheap?

> Robert
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list