[sf-lug] semi-OT: help with dying disk

Rick Moen rick at linuxmafia.com
Fri Mar 14 14:08:06 PDT 2008

Quoting jim stockford (jim at well.com):

>     if you're having the same problems on the same
> machine, verify that your power supply is okay.

Always good advice.  Many mysterious system problems are traceable
ultimately to weak PSUs; many snuffed-out hard drives and motherboards
are traceable to failing PSUs.

>     it's a good idea to use the -c option to mke2fs
> when you're putting an ext{2,3} filesystem on a
> partition.
> # mke2fs -c <device_name>

I personally -- in a more general sense -- like to occasionally set up a
spare machine as a "hard drive revamping" station:  Spare/used/old hard
drives get attached to either one of the motherboard's IDE PATA chains 
(since I don't own any SATA drives, yet) or to a SCSI HBA card.  Then
it gets interesting:

In the case of SCSI disks, you go into the HBA BIOS Setup program, and
use the built-in low-level formatting utility on the selected hard disk.
This rewrites all the timing tracks, rebuilds the hot-spare sector
collection, and so on.  The process takes quite a few hours, which is
why it's handy to have a spare machine for this purpose.

In the case of PATA or SATA (IDE) disks, you instead use the hard drive
manufacturer's pseudo-low-level formatting and diagnostic utility, which 
_either_ you can download yourself (see:  "# Hard Drive Utilities" on 
http://linuxmafia.com/kb/Hardware/ ) or use the collection of those
utilities on Ultimate Boot CD (http://www.ultimatebootcd.com/).  This
likewise rewrites the hard drive's low-level formatting data.

In either case (IDE or SCSI), you now have a much cleaner foundation on
the hard drive for filesystems -- which in many cases will give an
apparently flaky drive a new lease on life.

As for the final step, creating filesystems and checking for bad blocks,
the one refinement I would make to your suggestion is to do:

# mke{2,3}fs -c -c -v <devicename>

The doubling of "-c" causes the mkfs utility to call badblocks(8) with
its "-w" option, i.e., makes it do destructive read/write testing for
bad blocks on the filesystem you're specifying.  This in turn makes the
operation go a _lot_ faster (albeit still pretty pokey).  

More information about the sf-lug mailing list