Re: disk bad block checking post-install / ext2

From: prg (rdgentry1_at_cablelynx.com)
Date: 01/11/05


Date: 11 Jan 2005 08:06:13 -0800


Jules wrote:
> Hmm,
>
> does a utility exist to check a (SCSI) disk for bad blocks after
> installation?
>
> It seems that badblocks is designed to run at filesystem creation
time
> only (and really designed to be called by the relevant mkfs utility).
>
> One of the 18GB SCSI drives in my home fileserver (ext2 filesystem)
is
> starting to throw up the occasional disk error on the OS drive, and
> although I have a spare I can use I'd rather check other options
first...
>
> So,
>
> a) does anything exist to run a disk check whilst maintaining
filesystem
> integrity,

As others noted, $ man badblocks -- _very_ carefully.

Also, check if you have smartmontools on your distro. $ man smartd

Check if you can get a disk diagnostic/repair utility from the maker:
http://www.duxcw.com/faq/hd/diag.htm

> b) am I sort-of worrying about nothing because the SCSI firmware in
the
> drive itself is remapping bad blocks as soon as they're detected
anyway?

As noted, you only have so much spare disk space for remapping. And
the re-mapping is only available on first write -- it the hd can't
_read_ the block with data it will _not_ re-map.

> Of course seeing any disk errors seems cause for concern so I should
> probably replace the drive soon - just a question of whether to do it
ASAP
> or when I actually have a free moment!
>
> (Yes I do have regular backups before anyone asks ;)
(Keep them very handy!)

Badblocks is best run at fs creation time, but is handy afterwards
also. But to use it you must _know_ what you're doing _and_ generate a
table that the fs can read/use to avoid badblock marked blocks.

The hd badblock re-mapping _should_ be transparent, but if the hd can't
_read_ a block, it won't re-map it unless you force it (and likely lose
data).

For smartmontools visit:
http://smartmontools.sourceforge.net/

The more you use the flakey disks, the more likely you will lose data.
good luck,
prg
email above disabled