Subject: Bug#410209: conv=noerror poorly documented

From: Jiri Baum <[email-masked]>
Date: Fri, 9 Feb 2007 02:42:11 +1100

Package: coreutils
Version: 5.97-5

The documentation for the dd(1) 'noerror' keyword does not make it clear what 
happens to the blocks in which read errors occurred (or that this depends on 
the apparently-unrelated 'sync' keyword).

I would suggest that the current text "continue after read errors" (in the man 
and info pages) be expanded to indicate that without 'sync', input blocks 
with errors are dropped; with 'sync', whatever was read of input blocks with 
errors is padded to ibs and written. 

(If I understand the source correctly...)

For example, to read data off a failing disk, one should use:
  dd if=/dev/hdXY of=/filename.disk conv=noerror,sync

Omitting the 'sync' is a problem, since all offsets will be off from the first 
read error onwards and the size of the disk image will not match the size 
recorded in the superblock. This will lead to the following message from fsck 
when attempting to repair the disk image:

The filesystem size (according to the superblock) is X blocks
The physical size of the device is Y blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? 

Jiri
-- 
Jiri Baum <[email-masked]>                   http://www.baum.com.au/~jiri

---

From: Lucas Nussbaum <[email-masked]>
Date: Fri, 23 May 2008 23:43:48 +0200

Hi Jim,

Debian bug #410209 sounds like a sensible request for a doc (info page)
improvement.

Could you take a quick look?

Lucas

-- 
| Lucas Nussbaum
| [email-masked]   http://www.lucas-nussbaum.net/ |
| jabber: [email-masked]             GPG: 1024D/023B3F4F |

---

From: Jim Meyering <[email-masked]>
Date: Sat, 24 May 2008 08:25:09 +0200

> Could you take a quick look?

Hi Lucas,
Thanks for the heads-up.
And thanks to Jiri for the report!

Yes, that will make a fine improvement.
Jiri, do you feel like preparing a patch?
It'd be good to include the note about, and sample output from fsck, too.
If so, instructions for contributing are here:

  http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=blob;f=HACKING;hb=HEAD

If not, maybe Lucas will.

You may want to consider using ddrescue next time:
  http://www.gnu.org/software/ddrescue/ddrescue.html