hard drive errors

Ben Pfaff pfaffben@msu.edu
22 Jan 2001 10:09:12 -0500


Mike Rambo <mrambo@lsd.k12.mi.us> writes:

> I found at the end of last week that a few read errors on my hard drive
> are beginning to cause me trouble.  The errors are on the /home
> partition.  Does it sound reasonable to:
>  tar -zcvf the contents of /home
>  move it somewhere safe
>  umount /home
>  mke2fs -c /dev/hdb8
>  mount /dev/hdb8 /home
>  tar -zxvf the contents of /home

Is /dev/hdb the troubled drive?  If so, you're still living on
borrowed time.  Modern drives have a limited number of "remap"
blocks that are used to deal with bad parts of the platter.  Only
if the number of bad blocks exceeds the number of remap blocks do
actual errors typically come from the drive.  So a drive with an
apparent small number of bad blocks is generally a dying one.  In
my experience, of course; Your Mileage May Vary.

> In particular, will the -c flag properly create a media error map if
> needed ( the man page makes it sound like it should).  Is there a
> 'better way'(tm)?

It's a reasonable way.  There are some other options too:

	* `badblocks -w' can be used to test writing as well as
          reading.  It's a good choice if you're really
          suspicious, which I would be in this case.

	* `badblocks' in its default read-only mode could be used
          even on a mounted filesystem.  You could then unmount
          the drive, use `e2fsck -l' to add the bad blocks, and
          remount the drive.  This is a proper "hot fix"
          technique that avoids the backup/restore cycle.
-- 
"Welcome to the Slippery Slope. Here is your handbasket.
 Say, can you work 70 hours this week?"
--Ron Mansolino