Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Oct 2001 11:11:06 -0600
From:      "Kenneth D. Merry" <ken@kdm.org>
To:        Alexander Leidinger <Alexander@Leidinger.net>
Cc:        scsi@FreeBSD.ORG
Subject:   Re: repeating medium errors and error from "camcontrol defects"
Message-ID:  <20011026111106.A52864@panzer.kdm.org>
In-Reply-To: <200110261021.f9QALvR02396@Magelan.Leidinger.net>; from Alexander@Leidinger.net on Fri, Oct 26, 2001 at 12:21:56PM %2B0200
References:  <200110261021.f9QALvR02396@Magelan.Leidinger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 26, 2001 at 12:21:56 +0200, Alexander Leidinger wrote:
> Hi,
> 
> RELENG_4_4:
> 
> I get some errors:
> (da0:ahc0:0:0:0): READ(10). CDB: 28 0 0 f1 2b 50 0 0 c 0 
> (da0:ahc0:0:0:0): MEDIUM ERROR info:f12b59 asc:11,0
> (da0:ahc0:0:0:0): Unrecovered read error sks:80,29
> (da0:ahc0:0:0:0): READ(10). CDB: 28 0 0 f1 2b 50 0 0 c 0 
> (da0:ahc0:0:0:0): MEDIUM ERROR info:f12b59 asc:11,0
> (da0:ahc0:0:0:0): Unrecovered read error sks:80,29
> (da0:ahc0:0:0:0): READ(10). CDB: 28 0 0 f1 2b 50 0 0 c 0 
> (da0:ahc0:0:0:0): MEDIUM ERROR info:f12b59 asc:11,0
> (da0:ahc0:0:0:0): Unrecovered read error sks:80,29
> (da0:ahc0:0:0:0): READ(10). CDB: 28 0 0 f1 2b 50 0 0 c 0 
> (da0:ahc0:0:0:0): MEDIUM ERROR info:f12b59 asc:11,0
> (da0:ahc0:0:0:0): Unrecovered read error sks:80,29
> (da0:ahc0:0:0:0): READ(10). CDB: 28 0 0 f1 2b 50 0 0 c 0 
> (da0:ahc0:0:0:0): MEDIUM ERROR info:f12b59 asc:11,0
> (da0:ahc0:0:0:0): Unrecovered read error sks:80,29
> (da0:ahc0:0:0:0): READ(10). CDB: 28 0 0 f1 2b 50 0 0 c 0 
> (da0:ahc0:0:0:0): MEDIUM ERROR info:f12b59 asc:11,0
> (da0:ahc0:0:0:0): Unrecovered read error sks:80,29
> 
> They are from 9:44 to 11:20 in the morning.
> 
> I tried to issue "camcontrol defects da0 -f block -G", but I get
> "camcontrol: Error returned from read defect data command".
> 
> da0 at ahc0 bus 0 target 0 lun 0
> da0: <IBM DDRS-39130D DC1B> Fixed Direct Access SCSI-2 device 
> da0: 80.000MB/s transfers (40.000MHz, offset 15, 16bit), Tagged Queueing Enabled
> da0: 8715MB (17850000 512 byte sectors: 255H 63S/T 1111C)
> 
> What did I wrong with camcontrol and what can I do to get rid of those
> errors? Do I have to replace the disk or the cable?

As someone else already suggested, you should try using the 'phys' defect
format, as many drives don't support the block format.

As for the errors, they mean you have a bad block.  Replacing the cable
won't really affect the problem.  You may want to look into getting a new
drive, though, since medium errors typically indicate the drive is on its
way out.

To fix this particular bad block, what you should do is make sure read
and write reallocation are turned on in mode page 1:

camcontrol modepage da0 -m 1 -e -P 3

will allow you to edit the saved parameters and enable read and write
reallocation.

Then, write zeroes to the bad block to force the drive to remap it.

Joerg Wunsch posted a this basic command in response to a similar question
last week:

dd if=/dev/zero of=/dev/da0 skip=0xf12b59 count=1

The caveat is that according to the man page, skip causes dd to skip on the
input, not the output.  I would suggest looking at the dd(1) man page and
possibly using seek= instead.

Alternatively, you can turn the read command into a write command and issue
it via camcontrol:

camcontrol cmd da0 -v -c "2a 0 0 f1 2b 59 0 v:i2 0" 1 -o 512 - < /dev/zero

That should write 512 bytes (1 block) of zeros to block 0xf12b59.

Obviously all of this is somewhat "dangerous" if you make a mistake, and in
any case you're going to end up losing whatever data was in that 512 byte
block.

I normally use some variation of the camcontrol command above to force
block remapping.  I've thought about implementing a more automatic way of
bad block remapping in camcontrol, but haven't really gotten around to it.

Ken
-- 
Kenneth Merry
ken@kdm.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011026111106.A52864>