[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13135: Loss of data while copying
From: |
Eric Blake |
Subject: |
bug#13135: Loss of data while copying |
Date: |
Mon, 10 Dec 2012 08:09:44 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
tag 13135 notabug
thanks
On 12/10/2012 07:58 AM, Cojocaru Alexandru wrote:
> bash$ yes $(for i in $(seq 1 100000); do echo -n a; done) | dd of=big-lines
> ibs=100001 count=10000
> 9924+76 records in
Thanks for the report. Based on this output, short reads occurred. dd
transferred exactly 10000 reads as requested, but since some of those
were short, it transferred less than 10000*100001 bytes. This is
expected (and the behavior is described in that way by POSIX); the
solution you are looking for is to _also_ use the iconv=fullblock
option, to force dd to re-read until it has a full input block rather
than immediately transferring short input reads to output.
As such, I'm closing this as not a bug. Do feel free to add further
comments to this thread, though, if you have more questions about why dd
does this.
Oh, and by the way, 'echo -n' is not portable. You want to use
printf(1) instead.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- bug#13135: Loss of data while copying, Cojocaru Alexandru, 2012/12/10
- bug#13135: Loss of data while copying,
Eric Blake <=
- bug#13135: Loss of data while copying, Pádraig Brady, 2012/12/10
- bug#13135: Loss of data while copying, John Reiser, 2012/12/10
- bug#13135: Loss of data while copying, Eric Blake, 2012/12/10
- bug#13135: Loss of data while copying, John Reiser, 2012/12/10
- bug#13135: Loss of data while copying, Pádraig Brady, 2012/12/14
- bug#13135: Loss of data while copying, Jim Meyering, 2012/12/14