Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Nov 2001 21:56:13 -0600
From:      Mike Meyer <mwm@mired.org>
To:        Nils Holland <nils@tisys.org>
Cc:        questions@freebsd.org
Subject:   Re: dd and cat - Did I miss something?
Message-ID:  <15339.21469.343879.858201@guru.mired.org>
In-Reply-To: <42947041@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Nils Holland <nils@tisys.org> 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.

	<mike
--
Mike Meyer <mwm@mired.org>			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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15339.21469.343879.858201>