Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recovery from optical media ignoring read errors

I have backups of files archived in optical media (CDs and DVDs). These all have par2 recovery files, stored on separate media. Even in cases where there are no par2 files, minor errors when reading on one optical drive can be read fine on another drive.

The thing is, when reading faulty media, the read time is very, very long, because devices tend to retry multiple times.

The question is: how can I control the number of retries (ie set to no retries or only one try)? Some system call? A library I can download? Do I have to work on the SCSI layer?

The question is mainly about Linux, but any Win32 pointers will be more than welcome too.

like image 672
tzot Avatar asked Sep 29 '08 15:09

tzot


2 Answers

man readom, a program that comes with cdrecord:

   -noerror
          Do not abort if the high level error checking in readom found an
          uncorrectable error in the data stream.

   -nocorr
          Switch  the  drive  into  a mode where it ignores read errors in
          data sectors that are a result of uncorrectable  ECC/EDC  errors
          before reading.  If readom completes, the error recovery mode of
          the drive is switched back to the remembered old mode.
   ...

   retries=#
          Set the retry count for high level retries in readom to #.   The
          default  is  to do 128 retries which may be too much if you like
          to read a CD with many unreadable sectors.
like image 116
derobert Avatar answered Nov 03 '22 00:11

derobert


The best tool avaliable is dd_rhelp. Just

dd_rhelp /dev/cdrecorder /home/myself/DVD.img

,take a cup of tea and watch the nice graphics.

The dd_rhelp rpm package info:

dd_rhelp uses ddrescue on your entire disc, and attempts to gather the maximum valid data before trying for ages on badsectors. If you leave dd_rhelp work for infinite time, it has a similar effect as a simple dd_rescue. But because you may not have this infinite time, dd_rhelp jumps over bad sectors and rescue valid data. In the long run, it parses all your device with dd_rescue.

You can Ctrl-C it whenever you want, and rerun-it at will, dd_rhelp resumes the job as it depends on the log files dd_rescue creates. In addition, progress is shown in an ASCII picture of your device being rescued.

I've used it a lot myself and Is very, very realiable.

You can install it from DAG to Red Hat like distributions.

like image 42
motobói Avatar answered Nov 02 '22 23:11

motobói