Subject: Re: SCSI Error recovery and mapping out bad blocks
To: John Refling <johnr@imageworks.com>
From: Matthew Jacob <mjacob@feral.com>
List: port-sparc
Date: 12/03/1999 15:08:28
> I'm getting the following console messages:
> 
> Nov 27 12:16:06 oxford /netbsd: sd0(esp0:3:0):  Check Condition on CDB: 0x28 00 00 33 59 90 00 00 10 00
> Nov 27 12:16:06 oxford /netbsd:     SENSE KEY:  Recovered Error
> Nov 27 12:16:06 oxford /netbsd:    INFO FIELD:  3365265
> Nov 27 12:16:06 oxford /netbsd:  COMMAND INFO:  520 (0x208)
> Nov 27 12:16:06 oxford /netbsd:      ASC/ASCQ:  Recovered Data Without ECC - Data Auto-Reallocated
> Nov 27 12:16:06 oxford /netbsd:      FRU CODE:  0x2
> Nov 27 12:16:06 oxford /netbsd:
> Nov 27 13:17:39 oxford /netbsd: sd0(esp0:3:0):  Check Condition on CDB: 0x28 00 00 33 2d 20 00 00 10 00
> Nov 27 13:17:39 oxford /netbsd:     SENSE KEY:  Recovered Error
> Nov 27 13:17:39 oxford /netbsd:    INFO FIELD:  3353889
> Nov 27 13:17:39 oxford /netbsd:  COMMAND INFO:  520 (0x208)
> Nov 27 13:17:39 oxford /netbsd:      ASC/ASCQ:  Recovered Data Without ECC - Data Auto-Reallocated
> Nov 27 13:17:39 oxford /netbsd:      FRU CODE:  0x2
> Nov 27 13:17:39 oxford /netbsd:
> 
> which I assume mean that the hard drive reread the data
> successfully eventually, but there obviously is a bad block
> at sector 3365265 and 3353889.  In this case, it appears that
> the drive itself mapped these sectors elsewhere.
> 
> My question is this: is there a way to scan the disk, testing
> for bad or weak spots, then force the drive to map them out,
> after NetBSD is installed.  I think rabad did that on the old
> st-506 interfaces under other OSes.
> 
> Or, perhaps it is necessary to low level format on non-sparc
> hardware.  I think the 'verify' phase in Adaptec's PC adapters
> mapped out the bad sectors, as did the rzdisk format utility
> on DEC hardware under Ultrix.

The VERIFY command doesn't always do the best job of stuff, so basically a
read or write test with dd will do about as much you can get done.
Obviously the write test with dd is destructive.