Recovery from optical media ignoring read errors

linuxoptical-driverecoverysystem-callswindows

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.

Best Solution

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.