Subject: Re: can newfs do a surface scan or otherwise id bad disk blocks
To: None <port-i386@netbsd.org>
From: Takahiro Kambe <taca@back-street.net>
List: port-i386
Date: 11/13/2002 10:08:00
Please don't specify Reply-To if you really want to set.

In message <59170.210.54.88.120.1037148945.squirrel@alph.houseofet.com>
	on Wed, 13 Nov 2002 13:55:45 +1300 (NZDT),
	"Ernst du Toit" <et@houseofet.com> wrote:
> If the laptop drive is an IBM device it can map and flag the bad blocks in
> the drive firmware tables. Non IBM drives can also be tested but I'm not
> sure if the blocks can be flagged in firmware.
In general, IDE hard disks (not too old one) have a function replace
bad block with spare one.  But it happens on writing to a sector.

So, writing whole disk with dd(1) might repair those bad sectors.

# dd if=/dev/zero of=/dev/rwd0d

More better way is writing a program "check and write" for each
sector.  (Once I wrote a such program.)

If bad sectors couldn't recover, you had better think replace the disk
drive or be patient with bad blocks.  :-(

-- 
Takahiro Kambe <taca@back-street.net>