Sunday, February 21, 2010

Rescuing a CD in Archlinux

I have a CD with our favorite movie on it: Bud Spencer - Soldier of Fortune. I promised to my son to watch it together with him. Unfortunately the CD was faulty, KDE didn't recognise it. My son was so sad, I just had to do something about it.

tail -f /var/log/kernel.log

revealed "Buffer I/O error on device sr0, logical block 326084". After some failed attempts and reading some 'man mount' I found out how to mount the CD:

mount -r -t iso9660 -o nofail,ro /dev/sr0 /media/cd/

After this, ls /media/cd/ did show the file on the CD. Time to use the almighty dd utility. I found this blog entry to be very helpful:

http://decio.blogspot.com/2007/06/how-to-recover-files-from-damaged-cddvd.html

(On a side note, it seems the author of this blog uses GoboLinux, well done!)

So the command to rescue my CD was:

dd if=/media/cd/Zsoldoskatona.avi of=/tmp/Zsoldoskatona.avi bs=512 conv=noerror,sync

And we were able to watch the movie!