Copy: abort, retry, *ignore* 

Newsgroups: comp.os.linux.misc
Date: 19 Mar 2003 21:15:41 GMT
> I need an *ignore* option in a cp of large files from a CD to disk.

Lowlevel reading of a device and ignoring all read errors is always possible by using "dd if=$INPUT of=$OUTPUT bs=$BLOCKSIZE conv=noerror". This will, as is implied, ignore all read errors. Any blocks that dd is unable to read successfully will be replaced with blocks filled with 0x00. There's another, possibly more useful, program called dd_rescue that works like dd, except it reads a large block to start with, if it finds an error in that large block, it attempts to read smaller blocks, and it recurses that process until the block size goes down to 512 bytes and it's received a certain number of read errors on a particular 512-byte block. dd_rescue is *damned* useful if you have a partially dead hard disk with important data on it.

Matt G

Copy: abort, retry, *ignore* 

It is correct that you can either dd the block device, or dd individual files with the conv=noerror option. I have had mixed results. I think we have to distinguish between physical and logical read errors. The conv=noerror option can succeed when a checksum error has been found, meaning that some data have been read but it is known that the results are not what was originally written. A physical error on the device can result in a loss of track/sector locations and, I think, prevent a seek around the (localized) damage. In my case, there is physical damage. The dd conv=noerror just hung after the first Input/output error message.

Then I turned to myrescue, which operates on a file basis. myrescue has a slick little display that gives you hope. Alas, it too just hung.

Finally, after the suggestion of Dancing With Crows, I turned to dd_rescue. It did not hang, but it ran so slowly that I left the machine running and went to bed. After 8 hours or so dd_rescue had advanced only a few Mb.

Copy: abort, retry, *ignore* 

Here is a follow up of my experience. The situation is that I have a CD with iso9660 file system containing a number of valuable files. I can mount the CD and examine the directory, but a number of the files are unreadable, part of the file can be accessed, but at some point there is a read error. I hoped to be able to recover what I could from the file regardless of the content of unreadable sectors.

Treating the CD as a block device is a bad idea. None of the "rescue" resources are able to get past the first read-error, so the bulk of the CD is inaccessible.

Since the directory of the CD is readable, I can mount it and try to access the files individually. The no-brain rescue method is to try to cp the files to disk. Here is the kicker: in *every* case cp got more of the file than:

  1. dd with conv=noerrror
  2. myrescue
  3. dd_rescue