[colug-432] does dd double buffer? or can linux even do it?

Rob Funk rfunk at funknet.net
Mon Apr 8 13:53:05 EDT 2013


On Sunday, April 07, 2013 10:43:19 PM Vince Herried wrote:
> So my original question.  I have a Firewire connected disk drive and im
> doing a dd from it to an internal drive under Fedora 17.  The little
> activity light on the external drive comes on red for a 20 or so seconds,
> blinks out, then the disk drive light on my laptop blinks on for 20 or
> so seconds, blinks out and ....
> 
> Sure looks like single buffering,  Or my super whippy laptop cant do
> multiple I/O at same time,  Huh,  2nd generation computer?

Here's the source for GNU dd:
  http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/dd.c

Looks like whether it uses two buffers depends on this code in the 
argument-parsing function scanargs():

  if (blocksize)
    input_blocksize = output_blocksize = blocksize;
  else
    {
      /* POSIX says dd aggregates partial reads into
         output_blocksize if bs= is not specified.  */
      conversions_mask |= C_TWOBUFS;
    }

If I'm reading that right, it two buffers if you *don't* specify a block 
size.
Looking at other code, it uses two buffers if you specify these 
conversions: ascii, ebcdic, igm, block, unblock, lcase, ucase, or swab.


> OK I confess I'm really using dcfldd which is a nifty clone of DD that
> gives regular status updates for us type A persons that feel we need all
> the time INPUT.

The GNU dd docs mention this:
| Sending a USR1 signal to a running `dd' process makes it print I/O
| statistics to standard error and then resume copying.
|  $ dd if=/dev/zero of=/dev/null& pid=$!
|  $ kill -USR1 $pid; sleep 1; kill $pid



More information about the colug-432 mailing list