8

I have several old CDs that have scratches and won't play anymore. The same with a scratched video DVD. Is there any chance to recover the data using Ubuntu?

mniess
  • 10,546

2 Answers2

19

You can use ddrescue to recover damaged media. In contrast to regular dd it will not stop at unreadble sectors. This is especially promising with optical media because sometimes retries or reversed reading of the media yield different results.

Note: This method does not work for recovering scratched Audio-CDs.

Install

sudo apt install gddrescue

The Rescue

With ddrescue you can try to recover your data in multiple steps. Not all of which are always needed.

Step 1: Get the good data

In the first run we recover everything that is proberly readable and log what appears to be damaged.

ddrescue -b 2048 -n -v /dev/sr0 dvd.iso rescue.log

The blocksize of 2048 is the default blocksize of DVD media. The device name /dev/sr0 could be different on your system. Just run mount to find the correct name.

Step 2: Try the bad blocks

If you get no errors after step 1, your are done. If you do get errors, run the following command to concentrate on the bad blocks.

ddrescue -b 2048 -d -r 3 -v /dev/sr0 dvd.iso rescue.log

The parameter -d enables direct access to the device (requests do not go through the kernel), -r 3 is the number of retries for bad blocks.

If you still get errors, continue.

Step 3: Going backwards

Finally run this:

ddrescue -b 2048 -d -R -r 3 -v /dev/sr0 dvd.iso rescue.log

The parameter -R reverses the reading direction. This can ofter lead to several more blocks that can be successfully recovered.

Result

Even if you still have some errors, ddrescue will fill blocks that cannot be recovered with zeros, so that you do not get errors when playing back the media. Video-DVDs include a lot of error correction data. That means that even if you still have errors, you might not hear or see any problems with your recovered media.

mniess
  • 10,546
  • +1 :-) I have used dd_rescue for this purpose to rescue most of the video from two seriously scratched DVD disks for a friend of mine. It took long time (more than a week), but it was successful. By the way, the info page is very good, info ddrescue – sudodus Feb 08 '20 at 13:17
  • 1
    Should a different block size be used for CD ROMs? – Matthias Oct 07 '22 at 18:57
  • You can experiment but it shouldn't matter much. Go with powers of two, though. – mniess Oct 18 '22 at 10:48
1

I use dvdbackup:

> dvdbackup -p -i /dev/dvd -o my-out-dir/ -M

This creates my-out-dir/.../TS_VIDEO.

Then I use HandBrake to encode the data.

This way I was able to encode a scratched DVD.

guettli
  • 1,777