[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Putting It All On a Stick



Hi,

Eduard Bloch wrote:
> But for regular "push data around from FD to FD" job the only crucial
> difference I remember is the nasty behavior of dd when a short read
> occurres - aborting instead of retrying as cp does.

I saw it padding up short blocks and going on when i was
still on SuSE 10. This happened when reading from pipes with
slowly trickling data output.

Jessie's dd seems to be quite ok, though

  $ for i in 0 1 2 3 4 ; do echo bla ; sleep 1 ; done >fifo

and

  $ dd if=fifo bs=1024 >/tmp/dd_output
  0+5 records in
  0+5 records out
  20 bytes (20 B) copied, 5.00444 s, 0.0 kB/s

yields exactly 20 bytes in /tmp/dd_output. Not 5 KiB or 4 bytes.

(It seems not to block but rather read on after each of
 the 4-byte lines arrived. 5 reads. 20 bytes.)


The power of dd shows with commands like 

  dd if=/dev/zero conv=notrunc bs=1 seek=446 count=1 \
     of=debian-8.2.0-amd64-BD-1.iso

which zeros the "bootable/active" flag of MBR partition 1.


Have a nice day :)

Thomas


Reply to: