On Fri, 29 Aug 2003, David O'Brien wrote:

> On Fri, Aug 29, 2003 at 10:10:46AM -0700, Terry Lambert wrote:
> > David O'Brien wrote:
> > > On Thu, Aug 28, 2003 at 01:29:22AM -0700, Terry Lambert wrote:
> > > > 1)    dd if=/dev/acd0 count=1 of=/dev/null
> > > > 2)    dd if=/dev/acd0c count=1 of=/dev/null
> > > > 3)    dd if=/dev/acd0a count=1 of=/dev/null
> > >                                               ^^^^
> > >                                               bs=2k
> >
> > Yes, sorry; I forgot that FreeBSD's dd does not stat its endpoints
> > to see if they are devices, and gets the st_blksize and insists
> > that it be used (at least internally) for S_IFBLK and S_IFCHR
> > values of st_mode.
> >
> > Perhaps it should be unbroken by someone with a commit bit and/or
> > the ability to have their send-pr's not rejected as relay SPAM.
>
> I doubt it, this wasn't necessary with SCSI cdrom's until GEOM -- PHK
> thought it a feature to have to require the user to remember the "bs=2k",
> so I don't think anyone will ever be able to get this "fixed" in the
> tree.

This is not only a feaure; it is Standard.  From POSIX.1-2001-draft7.txt:

%%%
11599 NAME
11600                 dd - convert and copy a file
...
11650            ibs=expr        Specify the input block size, in bytes, by expr 
(default is 512).
11651            obs=expr        Specify the output block size, in bytes, by expr 
(default is 512).
%%%

GEOM has many faults, but this is not one of them.
"dd if=/dev/[a]cd0c [bs=512]" hasn't worked since block devices were axed.
With block devices, you had to use the raw device, e.g., /dev/racd0c, to
attempt to read 512-blocks and fail on normal cdroms because their block
size isn't 512.  /dev/acd0c was the block device so it could be read with
any size at some cost in efficiency..  E.g., requests to read it with a
block size of 512 caused the following enblocking and deblocking:

    - dd block size of 512 converted to BLKDEV_IOSIZE = 2048
    - i/o done with block size of 2048.  This happens to be the same as
      the physical block size, so it happens to work and doesn't involve
      any more enblocking or deblocking
    - BLKDEV_IOSIZE converted to dd block size.

BLKDEV_IOSIZE is now PAGE_SIZE and is only used for bogus things (since it
is still used but there are no block devices to use it on).

Bruce
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to