Subject: Re: wd(4) questions
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Dieter <netbsd@sopwith.solgatos.com>
List: netbsd-help
Date: 08/19/2005 14:21:45
> > Question 1:
> > 
> > dd if=/dev/rwd0c count=161507 bs=1512k of=/dev/null
> > dd: /dev/rwd0c: Input/output error
> > 160465+0 records in
> > 160465+0 records out
> > 248446033920 bytes transferred in 6623.766 secs (37508274 bytes/sec)
> > 
> > Looking in /var/log/messages:
> > 
> > /netbsd: wd0: transfer error, downgrading to Ultra-DMA mode 2
> > [ more read errors ]
> > /netbsd: wd0: transfer error, downgrading to Ultra-DMA mode 1
> > 
> > Is there a way to get wd(4) to upgrade the mode back without rebooting?
> > I don't see anything in wd(4) or atactl(8) man pages.
> 
> Not yet. It's still on my todo list but at very low priority ...

I was thinking... I'm guessing this speed downgrade is inherited from
PATA, where the unterminated cable is said to be marginal at best,
and running it at lower speed will likely work better.  Is reducing
the speed on a SATA connection actually likely to work any better?

> > Question 2:
> > 
> > dd if=/dev/zero of=/dev/rwd0c count=161507 bs=1512k
> > 
> > dd: /dev/rwd0c: Input/output error
> > 160466+0 records in
> > 160465+0 records out
> > 248446033920 bytes transferred in 37890.490 secs (6556949 bytes/sec)
> > 
> > I was expecting to see a disk write error logged in /var/log/messages,
> > but there is nothing?
> 
> Maybe it was missed by syslog, but it's present in dmesg output ?
> Also, if you're hitting the end of the disk, it's possible that the error was
> reported by bounds_check_with_mediasize(), in which case no message is
> printed.

I don't see any write errors in dmesg either. (see below)

It is not hitting the end of the disk, it still has 1613316096 bytes
(1042 1512k blocks) to go.  I set up the oddball count and bs arguments
to be exactly the size of the disk (from disklabel, below) to avoid
having dd smack into the end of the disk and generate an error message.
(I've gotten error messages from hitting the end of the drive before,
although that might have been with the sd driver rather than wd.)

"atactl wd0 identify" says:
Cylinders: 16383, heads: 16, sec/track: 63, total sectors: 268435455

I don't know where atactl is getting these numbers, but 268435455 sectors
is wrong.  That's only 137 GB.  atactl reports the same numbers for both drives.
Hmmm, could atactl's "total sectors" be per platter?  I think these drives are
supposed to have 133 GB per platter.

disklabel says:
	bytes/sector: 512
	sectors/track: 63
	tracks/cylinder: 16
	sectors/cylinder: 1008
	cylinders: 484521
	total sectors: 488397168

(again, same numbers for both drives)

488397168 * 512 = 250059350016   which matches the "250 GB" it is supposed to be.
I read the entire 488397168 sectors with dd on the "old" disk previously and it
worked fine.

Also, if I set the skip argument to dd I can read sectors beyond the
bad section without errors.

The other odd thing is I was expecting the drive to substitute spare sectors
when writing to it and thus fix the bad spot.  It should have something like
16-25 GB of spare sectors.

dmesg | tail -80

sd2: sync (100.00ns offset 8), 16-bit (20.000MB/s) transfers, tagged queueing
root on sd2a dumps on sd2b
readclock: 53/8/18/22/15/45=>1124403345 (1124403123)
init: copying out path `/sbin/init' 11
de0: enabling AUI/BNC port
wd0: no disk label
wd0: no disk label
[ more of the same ]
wd0: no disk label
wd0: no disk label
wd0c: error reading fsbn 485246160 of 485246160-485246287 (wd0 bn 485246160; cn 481395 tn 0 sn 0), retrying
wd0: (uncorrectable data error)
wd0c: error reading fsbn 485246160 of 485246160-485246287 (wd0 bn 485246160; cn 481395 tn 0 sn 0), retrying
wd0: (uncorrectable data error)
wd0c: error reading fsbn 485246160 of 485246160-485246287 (wd0 bn 485246160; cn 481395 tn 0 sn 0), retrying
wd0: (uncorrectable data error)
wd0: transfer error, downgrading to Ultra-DMA mode 2
wd0(satalink0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
wd0c: error reading fsbn 485246160 of 485246160-485246287 (wd0 bn 485246160; cn 481395 tn 0 sn 0), retrying
wd0: (uncorrectable data error)
wd0c: error reading fsbn 485246243 of 485246160-485246287 (wd0 bn 485246243; cn 481395 tn 1 sn 20), retrying
wd0: (uncorrectable data error)
wd0c: error reading fsbn 485246243 of 485246160-485246287 (wd0 bn 485246243; cn 481395 tn 1 sn 20)wd0: (uncorrectable data error)

wd0: no disk label
wd0: no disk label
wd0: no disk label
com1: 7 silo overflows, 0 ibuf floods
wd0: no disk label
[ more of the same ]
wd0: no disk label
wd0c: error reading fsbn 485244416 of 485244416-485244543 (wd0 bn 485244416; cn 481393 tn 4 sn 20), retrying
wd0: (uncorrectable data error)
wd0c: error reading fsbn 485244416 of 485244416-485244543 (wd0 bn 485244416; cn 481393 tn 4 sn 20), retrying
wd0: (uncorrectable data error)
wd0c: error reading fsbn 485244416 of 485244416-485244543 (wd0 bn 485244416; cn 481393 tn 4 sn 20), retrying
wd0: (uncorrectable data error)
wd0: transfer error, downgrading to Ultra-DMA mode 1
wd0(satalink0:0:0): using PIO mode 4, Ultra-DMA mode 1 (using DMA data transfers)
wd0c: error reading fsbn 485244416 of 485244416-485244543 (wd0 bn 485244416; cn 481393 tn 4 sn 20), retrying
wd0: (uncorrectable data error)
wd0c: error reading fsbn 485244488 of 485244416-485244543 (wd0 bn 485244488; cn 481393 tn 5 sn 29), retrying
wd0: (uncorrectable data error)
wd0c: error reading fsbn 485244488 of 485244416-485244543 (wd0 bn 485244488; cn 481393 tn 5 sn 29)wd0: (uncorrectable data error)

wd0: no disk label
wd0: no disk label
[ more of the same ]