From owner-freebsd-questions@FreeBSD.ORG Mon Dec 5 17:38:54 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 287191065670 for ; Mon, 5 Dec 2011 17:38:54 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email2.allantgroup.com (email2.emsphone.com [199.67.51.116]) by mx1.freebsd.org (Postfix) with ESMTP id B5C418FC15 for ; Mon, 5 Dec 2011 17:38:53 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email2.allantgroup.com (8.14.4/8.14.4) with ESMTP id pB5HcksC056104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 5 Dec 2011 11:38:47 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.5/8.14.5) with ESMTP id pB5HckGv086395 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 5 Dec 2011 11:38:46 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.5/8.14.5/Submit) id pB5Hck9U086393; Mon, 5 Dec 2011 11:38:46 -0600 (CST) (envelope-from dan) Date: Mon, 5 Dec 2011 11:38:46 -0600 From: Dan Nelson To: Patrick Lamaiziere Message-ID: <20111205173845.GA53453@dan.emsphone.com> References: <20111205105130.161fc78a@mr129166> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20111205105130.161fc78a@mr129166> X-OS: FreeBSD 8.2-STABLE User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.97.2 at email2.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (email2.allantgroup.com [199.67.51.78]); Mon, 05 Dec 2011 11:38:47 -0600 (CST) X-Scanned-By: MIMEDefang 2.68 on 199.67.51.78 Cc: FreeBSD Subject: Re: Command which does not work anymore? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 17:38:54 -0000 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@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@allantgroup.com