# Data recovery from CD-R

## angry_arctic_avian

I'm not sure is this is the right section to post this in, but it seems the be the most appropriate than any of the others. I recently took a CD-R disc to a Windows Vista using friend, so I could share some files with him, and after he stuck the disc in his box, it read the device as a blank disc and seemed to start formatting the disc. Now whenever I try to mount the disc, I get this message: mount: /dev/sr0: can't read superblock. This is the output I found in user.log:

```

M klogd: [209904.570573] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE

Nov 22 22:53:28 M klogd: [209904.570581] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current] 

Nov 22 22:53:28 M klogd: [209904.570588] sr 1:0:0:0: [sr0] Add. Sense: Logical block address out of range

Nov 22 22:53:28 M klogd: [209904.570597] end_request: I/O error, dev sr0, sector 0

Nov 22 22:53:28 M klogd: [209904.570601] __ratelimit: 8 callbacks suppressed

Nov 22 22:53:28 M klogd: [209904.570605] Buffer I/O error on device sr0, logical block 0

Nov 22 22:53:28 M klogd: [209904.572673] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE

Nov 22 22:53:28 M klogd: [209904.572679] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current] 

Nov 22 22:53:28 M klogd: [209904.572685] sr 1:0:0:0: [sr0] Add. Sense: Logical block address out of range

Nov 22 22:53:28 M klogd: [209904.572693] end_request: I/O error, dev sr0, sector 0

Nov 22 22:53:28 M klogd: [209904.572697] Buffer I/O error on device sr0, logical block 0

Nov 22 22:53:28 M klogd: [209904.611404] cdrom: This disc doesn't have any tracks I recognize!

Nov 22 22:53:31 M klogd: [209906.950002] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE

Nov 22 22:53:31 M klogd: [209906.950019] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current] 

Nov 22 22:53:31 M klogd: [209906.950026] sr 1:0:0:0: [sr0] Add. Sense: Logical block address out of range

Nov 22 22:53:31 M klogd: [209906.950034] end_request: I/O error, dev sr0, sector 0

Nov 22 22:53:31 M klogd: [209906.950479] FAT: unable to read boot sector

```

The disc was actually burned on the Ubuntu system that I had setup before I switched to Gentoo. Does anyone know if this is why Vista might have tried to reformat the disc? Could someone point me to the right tools or information on how I could recovery the data on this disc if such a thing is even possible. Thanks in advance.

----------

## jbarnes8

I'm not 100% sure what I'm talking about but I'm going to say it like I do. I'm just replying because no one else has.

Not to get technical on you, but you said it was a CD-R. You can't write to CD-R's. Perhaps there never was anything on the disc  :Wink: 

Vista uses a different iso 9660 format...despite ISO standing for the "International Standards Organization". I'm not sure about reading from disks, but as far as writing them for use in Linux it leads to problems. 

I would guess that if Vista did write to the disc it was only to the FAT though. You could TRY saving the disk as an iso on your hardrive and running fsck on it. I seriously doubt that will work but who knows. If that doesn't work, I'm not sure how you will find the files on the disc (where they begin and end), but the dd command may be in order for extracting them. You would literally have to know the begin and end address on the disc where the file is....I'm SURE there has got to be an easier way though.

One last thing...and probably the easiest and most useful if I'm right: I THINK I saw an experimental option in the kernel configuration underneath "filesystems->". I believe it was a module designed specifically to TRY to read mangled files systems. 

Hope that helps one way or the other

----------

## i92guboj

You can start by posting the info for that concrete disk. Do this while the disk is inserted, and paste the output here:

```
cd-info --no-device-info /dev/sr0
```

Change sr0 by whatever your drive is. That will give us an overview about whatever is inside the disk.

----------

## LesCoke

Sounds to me like the Vista machine automatically assumed the disk should be formatted in packet writing mode where explorer allows you to treat cd-r's like floppies.  Scary if Vista actually did this over an existing but unrecognized file-system.

Each packet writing system has historically been non-portable (nero, easy-cd,... each had their own driver and disk format).  Starting with windows XP M$ added built-in support for their own packet writing solution.  I thought there had been some standardization work in this area, but I recently had to read such a packet written disk from within one of my Windows VM's.  Linux was outputting errors similar to those shown above.

Not to hijack the thread, but is there a way to extract an ISO image from a CD-R using Lib-paranoia much in the same way that cdrdao can extract an audio CD in paranoid mode?  I doubt such a solution would help this case, but I would like to know which tools in Linux support doing this.

Les

----------

## jbarnes8

 *LesCoke wrote:*   

> 
> 
> Not to hijack the thread, but is there a way to extract an ISO image from a CD-R using Lib-paranoia much in the same way that cdrdao can extract an audio CD in paranoid mode?  I doubt such a solution would help this case, but I would like to know which tools in Linux support doing this.
> 
> Les

 

I don't know about lib paranoia so I may not understand why you're asking the question but you can:

$ dd if=/dev/cdrom of=/tmp/mycd.iso    (if=infile of=outfile)

and you have a raw image of the cd. Then you can even do: 

$mount /tmp/mycd.iso /mnt/some-mount-point

I believe you can also write to it too. Also I think you need to do it with your cdrom UNmounted

----------

## LesCoke

 *jbarnes8 wrote:*   

> 
> 
> I don't know about lib paranoia so I may not understand why you're asking the question but you can:
> 
> $ dd if=/dev/cdrom of=/tmp/mycd.iso    (if=infile of=outfile)
> ...

 

I knew about using dd to get the raw iso image.   But you are SOL if the disk is scratched beyond readability in spots, dd will just abort.  One of the dd-rescue variants will do something similar to what I want.

Lib-paranoia reads each sector of an audio CD multiple times, taking what makes the most sense (N reads that match).  This works because audio CD's do not have a robust ECC mechanism.  Using the paranoia options on cdrdao, I have ripped audio CDs that were scratched beyond normal playability, to have a bin/cue image with only minor ticks in spots (it can take days to do the rip, but very impressive results).

Les

----------

## angry_arctic_avian

Sorry for the late reply. I've been busy for the pass few days. Anyway, here is the resulting output from both try to copy the data with dd and the cd-info command:

```

dd if=/dev/cdrom of=/home/*****************/Desktop/imighthavetokillalexscomputer.iso

0+0 records in

0+0 records out

0 bytes (0 B) copied, 0.000549068 s, 0.0 kB/s

anti-christfucker@M ~ $ cd-info --no-device-info /dev/sr0

cd-info --no-device-info /dev/sr0

cd-info version 0.80 i686-pc-linux-gnu

Copyright (c) 2003, 2004, 2005, 2007, 2008 R. Bernstein

This is free software; see the source for copying conditions.

There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE.

CD location   : /dev/sr0

CD driver name: GNU/Linux

   access mode: ioctl

----------

## Jaglover

Is it a CD-R or RW?

One possible explanation is you had written your stuff as a session, your friends Vista tried to write another session but was interrupted. I think the way sessions are handled is every new session becomes first and has hooks to previous sessions. If the newest session is crippled all previous sessions become inaccessible. Well, that's what it think, based on some information I read long time ago and may not remember correctly.

----------

