dd can't write variable length data blocks to SCSI DDS streamer.
Spartak Radchenko
spartak at aif.ru
Sun Sep 14 10:03:18 PDT 2003
>Submitter-Id: current-users
>Originator: Spartak Radchenko
>Organization: Arguments & Facts Weekly
>Confidential: no
>Synopsis: dd can't write variable length data blocks to SCSI DDS streamer.
>Severity: serious
>Priority: high
>Category: kern
>Class: sw-bug
>Release: FreeBSD 4.9-PRERELEASE i386
>Environment:
System: FreeBSD corwin.aif.ru 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #0: Sun Sep 14 18:44:54 MSD 2003 spartak at corwin.aif.ru:/usr/obj/usr/src/sys/corwin i386
>Description:
dd can't write the last short data block to SCSI DDS streamer.
Moreover, it can't write variable length records, only in multiples of 1024.
This problem was introduced in RELENG_4 between Aug 14 and Sep 10 2003.
>How-To-Repeat:
corwin# dd if=/dev/zero ibs=1024 count=1 obs=1024 of=/dev/sa0
1+0 records in
1+0 records out
1024 bytes transferred in 0.001765 secs (580166 bytes/sec)
corwin#
1024 bytes are written, all OK.
corwin# dd if=/dev/zero ibs=1025 count=1 obs=1024 of=/dev/sa0
dd: /dev/sa0: Invalid argument
1+0 records in
1+0 records out
1024 bytes transferred in 0.004238 secs (241623 bytes/sec)
corwin#
The last byte from 1025 is lost. There is a message in /var/log/messages:
Sep 14 20:39:52 corwin /kernel: (sa0:ahd1:0:0:0): Invalid request.
Fixed block device requests must be a multiple of 1024 bytes
>Fix:
I don't know the fix for this problem. In some cases a simple workaround
can be used: dd if=... of=/dev/sa0 obs=1024 conv=osync
More information about the freebsd-stable
mailing list