Subject: Re: Reassigning defective blocks on direct SCSI devices
To: None <port-pmax@netbsd.org>
From: Andreas Kotes <count@flatline.de>
List: port-pmax
Date: 08/30/1999 15:14:54
Hi!

On Sun, 29 Aug 1999, Michael L. Hitch wrote:

> On Sun, 29 Aug 1999, Andreas Kotes wrote:
> 
> > I wasn't able to reassign defective blocks via scsictl on NetBSD 1.4 ..
> > it's either not acting like manpage says, or I'm using the wrong device
> > (tried /dev/rz4 rz4c rrz4 rrz4c ..) ...
> > 
> > ftp://ftp.netbsd.org/pub/NetBSD/misc/quick-hacks/sdremap doesn't compile
> > due to missing include files or me being stupid (hm. REASSIGN_BLOCKS isn't
> > defined anywhere, but quite vital) ..
> 
>   Both scsictl and sdremap use the MI SCSI code, which the pmax does not
> currently use.  The pmax driver does have a similar capability though, and
> I've done a few programs using the SDIOCSFORMAT/SDIOCSCSICOMMAND ioctl.

well, I found SCSI_REASSIGN_BLOCKS in /usr/include/dev/scsipi/scsi_disk.h,
but I still have to figure out how this is going to help me .. hm ..

> > So I end up with 4 questions:
> >  - is there a program that scans for bad blocks an remaps them?
> >  - how can I remap bad blocks if not by the methods I tried?
> 
>   This can probably be done with a modified sdremap program which uses the
> pmax SDIOCSFORMAT/SDIOCSCSICOMMAND ioctl calls.

hm. sdremap isn't that cool. better would be a program which finds the
errors and does a reassign-call itself.

> >  - can't this be done automagically? :)
> 
>   I think some SCSI drives can be configured to automatically reassign bad
> blocks.  I can't remember if there's any provision in that configuration
> to have the device notify the host that the reassignment was done, so
> having it done automatically may mean you get bad blocks reassigned
> silently and you don't know it was being done.

hm. the errors keep showing up at the same blocks .. so I don't think this
happens. I don't think I'll be able to switch this disk to automatic
reassignment ...

> >  - can I redirect the Media error message to anything else but
> >    the serial console? I'll loose console access to my system soon
> 
>   Don't those messages also show up in /var/log/messages?

whoops, they do. didn't see first

   Count

-- 
  -= Andreas Kotes - mailto:count@flatline.de - Questions? Just ask =-
 -= Micro$oft has a Year 2000 problem. I am part of it. I use Linux. =-
-= Commercial use of my email address NOT allowed. PGP key available. =-