Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Blogs > error_401
User Name


Rate this Entry

Data recovery from CD-ROM with Debian 6 Squeeze - ddrescue

Posted 12-12-2012 at 10:00 AM by error_401
Updated 01-14-2013 at 07:27 AM by error_401

I happen to have a huge amount of pictures but they are stored on CD-ROM's which over time start to loose data. Some after 3 years some are still readable after 12 years.

Nevertheless I want to recover as much data as possible and store it on my NAS. Now the task is not so straightforward as expected. Again the sheer mass of information sometimes hides the most obvious, or what is obvious to me was not to the developers or editors of tutorials.

The tasks are
1. Install a suitable software
2. Figure out how it works
3. Figure out your devices and prepare ddrescue
4. Use it on a damaged CD-ROM (data loss due bad sectors)
5. Recover as much data from data CD-ROM as possible
6. Make it accessible
7. Check the data recovered, delete unusable files and backup to NAS.

I will now describe in a bit more detail the process I've come up with.

1. Install a suitable software
In my case I opted for ddrescue from the GNU ddrescue. To install it in Debian Squeeze use

# apt-get install gddrescue
The GNU ddrescue is named gddrescue.

2. Figure out how it works
The manual can be found here:

This is still not very useful as all the examples given do not properly address my problem. I have only one copy of the CD-ROM. I can read it on multiple drives.

The capability of ddrescue to make multiple passes on the same medium and write all results into the same file may help recover as much as possible.

The difficulties are to figure the correct parameters for ddrescue to succeed which leads to the next point.

3. Figure out your devices and prepare ddrescue
I have created a directory for the recovered data to be stored. The correct drive letter may be found by inserting the CD-ROM. In my case the read errors on the console came in handy as they showed the device right away. So now I know my device names being /dev/sr0 for the CD-ROM and /dev/sr1 for the CD-DVD-BURNER.

To find the devices have a look into the /dev eventually using
ls /dev -al | more
to figure the devices and links to them. Scroll through the list looking for your devices, like:
lrwxrwxrwx 1 root root     3 9. Dec 20:26 cdrom -> sr1
lrwxrwxrwx 1 root root     3 9. Dec 20:26 cdrom1 -> sr0
lrwxrwxrwx 1 root root     3 9. Dec 20:26 dvd -> sr1
This will help properly identify the drives and device names for the proper use.

Now we can start using ddrescue.

4. Use it on a damaged CD-ROM
The CD-ROM is inserted in /dev/sr0 so I'll run a first recovery attempt using:

ddrescue -n -b 2048 /dev/sr0 /recovery/recover.iso /recovery/recover.log
Note that I have used full pathnames to avoid the log file to be in a different place depending from where you started ddrescue.

The second run I used the option described in the manual starting at point 0.

ddrescue -i0 /dev/sr0 /recovery/recover.iso /recovery/recover.log

ddrescue -d -r3 -b2048 /dev/sr0 /recovery/recover.iso /recovery/recover.log

The console output during the run includes information about the recovery. A good description I have found in German is from:

The most important is actually the "rescued: " entry which shows what could be rescued and how much. In addition the "errsize: " entry should decrease with every run.

I had to run ddrescue several times on the same CD-ROM with different settings. What also helped in one instance was to run it from the two different drives I have in my PC. The next experiment will be to copy the output and logfiles to my laptop and try an additional recovery run on a different CD-ROM drive.
Posted in Uncategorized
Views 623 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 01:33 AM.

Main Menu

Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration