Subject: dd does not copy same number of blocks
To: NetBSD alpha <port-alpha@netbsd.org>
From: Uwe Lienig <uwe.lienig@fif.mw.htw-dresden.de>
List: port-alpha
Date: 08/29/2006 10:25:36
Hello alpha fellows,

I have a problem copying a SCSI drive with hard defects to another identical drive.

The system is a DEC3000/300 with NetBSD-1.6.2. The disks are configured as

sd31 at scsibus3 target 1 lun 0: <IBM, DDYS-T18350N, S96H> SCSI3 0/direct fixed
sd31: 17501 MB, 15110 cyl, 6 head, 395 sec, 512 bytes/sect x 35843670 sectors
sd31: sync (100.0ns offset 15), 8-bit (10.000MB/s) transfers, tagged queueing
sd33 at scsibus3 target 2 lun 0: <IBM, DDYS-T18350N, S96H> SCSI3 0/direct fixed
sd33: 17501 MB, 15110 cyl, 6 head, 395 sec, 512 bytes/sect x 35843670 sectors
sd33: sync (100.0ns offset 15), 8-bit (10.000MB/s) transfers, tagged queueing

sd31 has hard, non-recoverable read errors.

I used dd.

dd if=/dev/rsd31c bs=1b conv=noerror,sync of=/dev/rsd33c

After 24 hours of copying dd wrote:
35843671+0 records in
35843670+0 records out

Where does this difference does come from? Has the source drive sd31 been copied 
correctly onto target drive sd33? sd31 does have only 35843670 blocks, not 
35843671 blocks. Is the extra block caused by reading after end of the physical 
drive?

Any hints are welcome!
-- 


Uwe Lienig
----------
fon: (+49 351) 462 2780
fax: (+49 351) 462 3476
mailto:uwe.lienig@fif.mw.htw-dresden.de

Forschungsinstitut Fahrzeugtechnik
<http://www.fif.mw.htw-dresden.de>
parcels: Gutzkowstr. 22, 01069 Dresden
letters: PF 12 07 01,    01008 Dresden

Hochschule für Technik und Wirtschaft Dresden (FH)
Friedrich-List-Platz 1, 01069 Dresden