cd writing/reading problem

cd writing/reading problem

Post by Stefano Ghirlan » Thu, 30 Sep 1999 04:00:00



Hi,
I am using cdrecord 1.6.1 on slackware 3.6.
I am burning to the cd data streams directly, not filesystems, for back up
purposes. I write a header at the beginning of each archive with ojnfo
about size etc. so that I can search through the disk later on for the
archives I want to recover. My problem is that although cdrecrod works
fine in writing the tracks, I can't access anything beyond the first
track, e.g. using dd.

For example, here is what should be on the disk:

# cdrecord dev=2,0 -toc
[... deleted stuff ...]
first: 1 last 5
track:   1 lba:         0 (        0) 00:02:00 adr: 1 control: 4 mode: 1
track:   2 lba:     19563 (    78252) 04:22:63 adr: 1 control: 4 mode: 1
track:   3 lba:     44156 (   176624) 09:50:56 adr: 1 control: 4 mode: 1
track:   4 lba:     51358 (   205432) 11:26:58 adr: 1 control: 4 mode: 1
track:   5 lba:     58702 (   234808) 13:04:52 adr: 1 control: 4 mode: 1
track:lout lba:     59146 (   236584) 13:10:46 adr: 1 control: 4 mode: -1

Here is how I can get the header which starts the first archive:

# dd if=/dev/scd0 ibs=512 count=1
Bytestream by backburner, raw stream begins after this 512 byte header
MediaID=938086392  ArchiveID=homecarladambackup.tar.bz2-FULL  MediaNum=1
MediaCap=642998272  MediaLen=16712669  LastMedia=1  Device=cdr  ---End of
Header---
1+0 records in
1+0 records out

The MediaLen fields tells me how many bytes the archives contains. With
this information I can extract the archive with dd and un-bzip2 and untar
it with no problem. But if I try to read the next header:

# dd if=/dev/scd0 ibs=512 count=1 skip=32644
dd: /dev/scd0: I/O error
0+0 records in
0+0 records out

I even tried to read the whole cd into one file to inspect it later but it
gives the same I/O error at the same point. When this happens here is what
appears in the logs:

Sep 29 10:19:57 wallace kernel: CD-ROM I/O error: dev 0b:00, sector 32644
Sep 29 10:19:57 wallace kernel: scsi0: MEDIUM ERROR on channel 0, id 2,
lun 0, CDB: Read (6) 00 7f 88 1c 00  
Sep 29 10:19:57 wallace kernel: Current error sr0b:00: sense key Medium
Error
Sep 29 10:19:57 wallace kernel: Additional sense indicates No reference
position found
Sep 29 10:19:57 wallace kernel: CD-ROM I/O error: dev 0b:00, sector 32648
Sep 29 10:19:59 wallace kernel: scsi0: MEDIUM ERROR on channel 0, id 2,
lun 0, CDB: Read (6) 00 7f 8c 18 00  
Sep 29 10:19:59 wallace kernel: Current error sr0b:00: sense key Medium
Error
Sep 29 10:19:59 wallace kernel: CD-ROM I/O error: dev 0b:00, sector 32652
Sep 29 10:20:06 wallace kernel: CD-ROM error: Current error sr0b:00: sense
key Illegal Request
Sep 29 10:20:06 wallace kernel: Additional sense indicates End of user
area encountered on this track
Sep 29 10:20:06 wallace kernel: command was: Read (6) 00 7f 90 14 00  
Sep 29 10:20:06 wallace kernel: CD-ROM I/O error: dev 0b:00, sector 32656

I gather I don't understand how to move around cds.
Any help will be greatly appreciated,
thanks,
Stefano

 --
 Stefano Ghirlanda, Zoologiska Institutionen, Stockholms Universitet
    Office: D554, Arrheniusv. 14, S-106 91 Stockholm, Sweden

   Support Free Science, look at: http://rerumnatura.zool.su.se

 
 
 

1. cd writing/reading problem

Hi,
I have the following problem with cd writing. CD-Writing-HOWTO, cd
writing FAW, cdrecord docs did not help. I am working on a
stream-oriented backup software for cds. I write streams of data to the
cd, not filesystems, and I would like to get them back of course.

I use cdrecord for writing. At the beginning of each data stream I write a
header with length information so that I can dd back the piece of cd I
need. Each data stream is written as a session. The proble is that dd
doesn't work when I look for data streams (sessions) after the first.
I get one or two sectors (512B) of empty space and then I/O error.
For example here is how I get the first header on the cd:

#  dd if=/dev/scd0 ibs=512 count=1
Bytestream by backburner, raw stream begins after this 512 byte header
MediaID=938086392  ArchiveID=homecarladambackup.tar.bz2-FULL  MediaNum=1
MediaCap=642998272  MediaLen=16712669  LastMedia=1  Device=cdr  ---End of
Header---
1+0 records in
1+0 records out

This is correct. I can extract the tar.bz2 archive fine. I know that there
is a second archive after this one (e.g. as shown by cdrecord -toc). I try
to get it looking after 32642 blocks of 512 bytes (which should be the
right size):

# dd if=/dev/scd0 ibs=512 count=1 skip=32642
1+0 records in
1+0 records out

ok, this was some empty padding at the endo of the track... I see the same
skipping one block further, but:

# dd if=/dev/scd0 ibs=512 count=1 skip=32644
dd: /dev/scd0: I/O error
0+0 records in
0+0 records out

and then I do not know what to do...
Can this be a fault in my setup or am I missing something?
I am using cdrecord 1.6.1 on slackware 3.6.
Thanks a lot,
Stefano

--
 Stefano Ghirlanda, Zoologiska Institutionen, Stockholms Universitet
    Office: D554, Arrheniusv. 14, S-106 91 Stockholm, Sweden

   Support Free Science, look at: http://rerumnatura.zool.su.se

2. Solaris Certification

3. Sockets: write() writes OK, yet read() reads garbage...?

4. Elsa Winner1000pro and Linux: Probs

5. Problem with reading CD-R/W written in TAO mode

6. htpasswd problem

7. RH9 with HP 8200e CD burner, writes but has problems reading?

8. Call Back w. SCO 5 PPP ?

9. Problems reading CDs written on PC

10. weird problem reading Adaptec-written CD-R

11. Problems with serial link while reading or writing CDs

12. Won't read music CD, will read data cd?

13. Can't Read cdrecord Written Data to HP CD-Writer Plus 9110i . . .