From owner-freebsd-questions Thu Nov 8 19:56:24 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-31-203-60.mmcable.com [65.31.203.60]) by hub.freebsd.org (Postfix) with SMTP id 6D0F937B417 for ; Thu, 8 Nov 2001 19:56:16 -0800 (PST) Received: (qmail 38455 invoked by uid 100); 9 Nov 2001 03:56:13 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15339.21469.343879.858201@guru.mired.org> Date: Thu, 8 Nov 2001 21:56:13 -0600 To: Nils Holland Cc: questions@freebsd.org Subject: Re: dd and cat - Did I miss something? In-Reply-To: <42947041@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Nils Holland types: > On Thu, 8 Nov 2001, Scott Nolde wrote: > > Try dd if=/dev/acd0c of=cdimage.iso bs=2048k > Indeed, that works! Strange, I thought I had done that in the past without > specifying bs. Anyway, thanks for the help! For the archives, what's happening is that data cd's have a block size of 2048. That means you have to read a multiple of 2048 bytes at a time. dd defaults to reading 512 bytes at a time, and that's the "Invalid Argument" it complained about. Changing the blocksize on dd made the device happy. cat, on the other hand, asks the system what the block size is on the file it's reading from, so it uses the right block size and is happy without such tweaking. Yes, you used to be able to use dd without the block size. You were using the "cooked" device, which caused the IO to be buffered by the OS, so the OS took care of all these details for you. Cooked devices only existed to serve the systems buffer cache. The buffer cache rewrite made that need vanish, so cooked devices vanished. The device names weren't changed, but both raw and cooked device names now refer to the raw device. The raw device has always failed this way. Personally, I think this change is a violation of POLA, as most Unices support cooked devices doing "the right thing." Not all of them did, so using them that way is a bad - albeit very common - habit that we're going to have to get over. http://www.mired.org/home/mwm/ Q: How do you make the gods laugh? A: Tell them your plans. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message