Command which does not work anymore?

Dan Nelson dnelson at
Mon Dec 5 17:38:54 UTC 2011

In the last episode (Dec 05), Patrick Lamaiziere said:
> Hello,
> I'm using 9.0 and the command below does not work, as far I remember
> that worked fine with 8.2:
> The goal is to copy an usb image from an OpenBSD host to an usb key on
> my desktop via ssh.
> On openbsd:
> # cat ucop2.img | ssh patrick at xx dd of=/dev/da0 bs=10M
> dd: /dev/da0: Invalid argument
> 0+5 records in
> 0+4 records out
> 81920 bytes transferred in 0.107747 secs (760299 bytes/sec)

dd with a bs= option tells dd to use read() syscalls with a 10mb size, but
ssh is going to feed it data in much smaller chunks, and they're unlikely to
be multiples of a disk block in size (which you have to use if you are
writing directly to a raw disk device).  The "0+5 records in/0+4 records
out" lines say that dd read 5 blocks of data (but they were less than 10mb),
and wrote 4 blocks (again less than 10mb).  Try using a smaller blocksize
(8k or 4k), or use a buffering program like ports/misc/team or misc/buffer
just in front of your dd command, so that dd always sees block-sized writes
from its stdin stream.

If that command worked in 8.2, it was just by accident.

	Dan Nelson
	dnelson at

More information about the freebsd-questions mailing list