In message <51543b7a.4030...@qeng-ho.org>, Arthur Chance <free...@qeng-ho.org> wrote:
>On 03/28/13 10:32, Ronald F. Guilmette wrote: >> It is possible, I would guess, that dd may notice the EOF occuring >> before it has filled up an entire input buffer, and then just quit >> at that point, _without_ writing the partial last block to the >> output device. > >It will attempt to write a short block. E.g. > >arthur@fileserver[2]> ls -l t.pdf >-rw-rw-r-- 1 arthur arthur 233812 Feb 18 12:26 t.pdf >arthur@fileserver[2]> dd if=t.pdf of=/dev/null bs=1k >228+1 records in >228+1 records out >233812 bytes transferred in 0.036731 secs (6365521 bytes/sec) > >Those +1 records are the final short block. OK. Thanks. That's definitely good to know. I wonder if this behavior is documented in the man page. (It certainly should be, if it isn't already.) >> It seems to me that conv=sync is cheap insurance against this >> possibility. > >It's used as an insurance against output devices which have a fixed (or >in the case of tape, a minimum) block size. If the short block is not an >exact integer multiple of the device block size then the final write >will fail. Right. I understand. >conv=sync and a bs (or obs) that's a strict multiple of block >size prevents the problem. That's exactly your use case. Right. Regards, rfg _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"