[TriLUG] getting dd if=[flaky device] to ignore read errors

Kevin Otte nivex at nivex.net
Mon Jan 22 18:41:07 EST 2007


Brian Henning wrote:
> *rubs eyes*
> 
> There it is, right in front of my face.  Thanks for not being a jerk
> about pointing out the obvious to me. :-D  My excuse is "it's Monday."
> 
> The question becomes, then, what is the output when the input is an
> error?  Garbage or nothing?

By default, nothing.  It will only write as much of the block as you
were able to read.

> I think it might make for a more difficult recovery (then again,
> maybe it won't) if, for example, 100 good bytes + 10 errors [in] ==
> 100 bytes out, instead of 110 bytes out (10 of which are garbage).

Quite right.  This is why you will also need the "sync" option to conv.
 That will write NUL bytes in place of what would be garbage.

My references:
http://www.macosxhints.com/article.php?story=20050302225659382
dd(1) manual page

-- Kevin




More information about the TriLUG mailing list