From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 21 11:43:00 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4500116A4BF for ; Thu, 21 Aug 2003 11:43:00 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB0F943F3F for ; Thu, 21 Aug 2003 11:42:57 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.9/8.12.9) id h7LIgvaw029357; Thu, 21 Aug 2003 13:42:57 -0500 (CDT) (envelope-from dan) Date: Thu, 21 Aug 2003 13:42:57 -0500 From: Dan Nelson To: Brian Reichert Message-ID: <20030821184256.GA82969@dan.emsphone.com> References: <20030821183421.GN85538@numachi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030821183421.GN85538@numachi.com> X-OS: FreeBSD 5.1-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org Subject: Re: dd to floppies broken? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2003 18:43:00 -0000 In the last episode (Aug 21), Brian Reichert said: > % ls -ln memtest86-*/precomp.bin > -rw------- 1 1001 1001 84480 Feb 28 2002 memtest86-2.9/precomp.bin > -rwx--x--x 1 1001 1001 84420 May 21 2002 memtest86-3.0/precomp.bin > > When copying these to a floppy as root (using two different machines, > and several floppes for testing:) > > # dd bs=8192 of=/dev/fd0 if=memtest86-2.9/precomp.bin > 10+1 records in > 10+1 records out > 84480 bytes transferred in 3.775199 secs (22378 bytes/sec) > > # dd bs=8192 of=/dev/fd0 if=memtest86-3.0/precomp.bin > dd: /dev/fd0: Invalid argument > 10+1 records in > 10+0 records out > 81920 bytes transferred in 3.731600 secs (21953 bytes/sec) > > Got any quick clues, or should I just file a PR now? (I don't > even know what to report, really...) You can only write full blocks to raw devices. The first file is 84480/512 = 165 disk blocks on the dot. The second file is 164.8828125 blocks, and that last fragment is why the dd is failing. Try adding conv=osync to your dd line to tell it to pad the last block out. -- Dan Nelson dnelson@allantgroup.com