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



Relevant Pages

  • Re: How many tests under mkfs.ext3 -c -c ?
    ... > prg wrote: ... The speed is even slower since, IIRC, this is raw disk access, ... Badblocks stores it's info in the fs structure. ... Some HD utils rebuild the _disk's_ bad sector table. ...
    (comp.os.linux.setup)
  • Re: Corrupt data - RAID sata_sil 3114 chip
    ... Well, Carlos' email bounces, so much for that one. ... with it on a 250GB disk, it got massive corruption very quickly. ... I ran badblocks -v -w -s on the disk, ... (Though why only the 0x00 pattern fails would still be a mystery). ...
    (Debian-User)
  • Re: How does the badblock test work in R.H. installer (Anaconda)?
    ... I have never been very convinced that badblocks is any use ... > nowadays - disks will remap internally if they lose a sector, ... The rate should be that of the disk, unless it can saturate the pci ... verify follows, and a rewrite occurs. ...
    (linux.redhat.misc)
  • Re: Can badblocks change the size of a hard drive?
    ... ran badblocks on it, with the destructive write -w option, and there ... Is the size of the hard drive, as seen by Linux, stored in some sector ... What happens if you recreate and reformat the partitionon the disk? ... martin@ | Martin Gregorie ...
    (uk.comp.os.linux)
  • Re: Bad sectors on /dev/hda
    ... isolate those identifed from the filesystem. ... means not even "badblocks" is actually useful ... That gives the least access to the damaged disk..I suspect that disk failure is largely due to chunks of oxide falling off..the less they get shuffled around to score up good sectors the better. ...
    (comp.os.linux.misc)