Subject: Re: dd strangeness
To: Tad Hunt <tad@entrisphere.com>
From: Trevin Beattie <trevin@xmission.com>
List: tech-kern
Date: 06/21/2002 14:57:06
At 02:20 PM 6/21/2002 -0700, Tad Hunt wrote:
>
>I've got a NetBSD-1.5 system containing a IBM Microdrive with the
>disklabel below.  When I enter the following command:
>
>	# dd if=/dev/wd0d of=/dev/null bs=512
>
>It runs fine for a long while, then at the end of the disk, I get a
>bunch of these:
>
>	wd0d: id not found reading fsbn 700560 of 700560-700567 \
>		(wd0 bn 700560; cn 695 tn 0 sn 0), retrying
>	...
>
>	wd0d: id not found reading fsbn 700568 of 700568-700575 \
>		(wd0 bn 700568; cn 695 tn 0 sn 8), retrying
>	...
>
>Why is dd attempting to read fsbn 700560 and 7700568, when the disk
>ends at 700559 (see the disklabel)?
>
>Is this the expected behavior?
>
>dd(1) exits with an "Input/output error", this can't be right...
>
>	dd: /dev/wd0d: Input/output error
>
>Has anyone else ever seen this behavior?

Yeah, I've seen the same thing during my initial tests for large-sectored
disks.  In reading the code (and discussing things with our fs experts) I
found out why.

Simply put, NetBSD ignores any partition boundaries for the 'whole disk'
partition.

It does things that way by design, as I understand it, in case the disk
label is incorrect or corrupt.  That way you can still access all parts of
the disk, even if the label (for example) said it only has 1 sector.

The error is harmless, but if you want to avoid it, simply use the 'count='
parameter in dd.

-----------------------
Trevin Beattie          "Do not meddle in the affairs of wizards,
trevin@xmission.com     for you are crunchy and good with ketchup."
      {:->                                     --unknown