1) stat(2), the st_blksize field in the stat struct
2) no, because it's the device, not dd, that's not letting it work.
CD-ROMS only want to output 2K of data at a time, so if you request
less than that, they just won't do it. Generally though, most devices
will output less than st_blksize, but it'll just go damn slow.

Jason

On 5/31/06, akonsu <[EMAIL PROTECTED]> wrote:
 thanks everybody.

1. how do i determine the corect block size for a device?
2. is the fact that dd does not work without any bs parameter a bug and
should be reported?

thanks
konstantin

try
>    dd if=/dev/rcd0c of=disk.iso bs=32k
>
> note the "rcd0c" instead of "cd0a".  The 'a' vs. 'c' doesn't (seem to)
> matter, I just philosophically prefer the 'c' implying entire disk,
> rather than just one partition.  The "raw" mode of access makes a lot of
> difference here.
>
> I put the "bs=32k" in there for a bit of additional performance, but it
> turns out that without the "bs=" line, it didn't work at all.  After a
> little thought (and testing), I remembered that on most modern
> platforms, CDROM drives have a 2k block size, so apparently dd has
> trouble moving 512 bytes at a time out of CDROM drives.  I confirmed
> that "bs=2k" worked, "bs=1k" does not, so I might possibly be not
> totally wrong on that.  "bs=32k" seemed to go about twice as fast as
> "bs=2k".
>
> Well, I learned something. :)
>
> Nick.

Reply via email to