GNU bug report logs - #59809
dd: Summary discrepancy with iflag=fullblock if the last write would be partial

Previous Next

Package: coreutils;

Reported by: Sworddragon <sworddragon2 <at> gmail.com>

Date: Sat, 3 Dec 2022 23:33:02 UTC

Severity: normal

To reply to this bug, email your comments to 59809 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#59809; Package coreutils. (Sat, 03 Dec 2022 23:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sworddragon <sworddragon2 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 03 Dec 2022 23:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sworddragon <sworddragon2 <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: dd: Summary discrepancy with iflag=fullblock if the last write would
 be partial
Date: Sat, 3 Dec 2022 23:32:39 +0000
[Message part 1 (text/plain, inline)]
Hi,

I'm using Knoppix 9.1 (x86_64 environment) (from early 2021 - but this is
the most recent version of it that is public available) with GNU Coreutils
8.32.

I was overwriting a HDD and wanted to try out the iflag=fullblock option -
despite not strictly needed for that special case but this shouldn't
matter. Here is the output that I got (freely translated form german to
english so some terms might be a bit off):

root <at> Microknoppix:~# dd if=/dev/random iflag=fullblock of=/dev/sda bs=1M
conv=fsync status=progress
320059998208 Bytes (320 GB, 298 GiB) copied, 5519 s, 58.0 MB/s
dd: Error on writing to '/dev/sda': No sufficient disk space available on
the device
305246+0 records in
305245+0 records out
320072933376 Bytes (320 GB, 298 GiB) copied, 5539.18 s, 57.8 MB/s


(That the output from status=progress mismatches with the final result is
due to bug https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51482 which should
be already fixed so just ignore that)

The summary tells me that 320072933376 Bytes have been written which does
not match a multiple of bs=1M which implies my HDD has been fully
overwritten with random data - which would also match the documentation for
iflag=fullblock since it should never affect partial writes.
However, the previous line tells me that 305245+0 records have been written
which tells me that the last 352256 Bytes of my HDD haven't been
overwritten with random data.

So there is a discrepancy in the output where the second last line tells me
"305245+0 records out" while the last line basically tells me "305245+1
records out" - which one is now true?

So this issue seems to be a summary bug and in the worst-case also a
dataloss bug.


Edit: To test this further I did now a run of the same command just without
iflag=fullblock and I got pretty much the same result (305246+0 records in,
305245+0 records out, 320072933376 Bytes copied).
So this issue seems to be not related to iflag=fullblock - but the
discrepancy in the summary still exists. In this run I would have expected
to see "305245+1 records out" and I'm now curious again if my HDD has been
fully overwritten or not.

Maybe somebody can shed some light into this if something is indeed broken
or if I just miss something that I can't figure out.
[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.