Skip to contentSkip to conversation

dd cdrom error

DISCUSSION Douglas Gilbert 3 participants 5 messages Dec 27, 2001 – Dec 28, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines · Leung Yau Wai

I come across a problem which seem exist in kernel 2.4.x but not in 2.2.x.

The problem is that, when I try to using dd to create a ISO image of a cdrom then around dumping the end of the disc it will give out the following error message:

e.g. dd if=/dev/cdrom of=n.iso

If dd is used like that, it is surprising you do not get more errors. An iso9660 image does not necessarily fill the track. So the IDE equivalent of the SCSI READ CAPACITY command will often report a size that includes unwritten sectors at the end. Those unwritten sectors can/will cause IO errors when an attempt is made to read them.

A very useful program called "isosize" has made a return to util-linux-2.10s (and later). Execute:
isosize -x /dev/cdrom
to find the number of sectors and the sector size of the iso9660 fs held _within_ the first track. Then use those numbers as the "count=" and "bs=" arguments to dd respectively.

If you still have problems try turning DMA off via hdparm or set the DMA mode back to 33 MHz (-X34).

Doug Gilbert

#1 lore raw
Quoted 25 lines · Douglas Gilbert
Quoted 8 lines · Leung Yau Wai

I come across a problem which seem exist in kernel 2.4.x but not in 2.2.x.

The problem is that, when I try to using dd to create a ISO image of a cdrom then around dumping the end of the disc it will give out the following error message:

e.g. dd if=/dev/cdrom of=n.iso

If dd is used like that, it is surprising you do not get more errors. An iso9660 image does not necessarily fill the track. So the IDE equivalent of the SCSI READ CAPACITY command will often report a size that includes unwritten sectors at the end. Those unwritten sectors can/will cause IO errors when an attempt is made to read them.

A very useful program called "isosize" has made a return to util-linux-2.10s (and later). Execute:
isosize -x /dev/cdrom
to find the number of sectors and the sector size of the iso9660 fs held _within_ the first track. Then use those numbers as the "count=" and "bs=" arguments to dd respectively.

Quoted 2 lines

If you still have problems try turning DMA off via hdparm or set the DMA mode back to 33 MHz (-X34).

So, why problem will be happened when using DMA?

Do you mean when not using DMA then the sectors at the end of the
disc will be auto-filled (padded)? ( I think it is impossible )

BTW, why kernel 2.2.X will success create the ISO image of the
same disc with the same command?

Thx your reply!

#2 lore raw
Quoted 2 lines

BTW, why kernel 2.2.X will success create the ISO image of the
same disc with the same command?

The 2.2 kernel knows that errors in the last few blocks of an ISO image are not in fact to be counted as errors and retried. Apparently that got lost somewhere. Maybe Jens knows ?

#3 lore raw
Quoted 6 lines · Alan Cox
Quoted 2 lines

BTW, why kernel 2.2.X will success create the ISO image of the
same disc with the same command?

The 2.2 kernel knows that errors in the last few blocks of an ISO image are not in fact to be counted as errors and retried. Apparently that got lost somewhere. Maybe Jens knows ?

But, why turning off DMA 'hdparm -d0 /dev/hdd' then everything
work fine? Do you mean if turning off DMA then 2.4 kernel also knows that errors in the last few blocks of an ISO image are not in fact to be counted as errors and retried? Also Jens knows?

Chris

#4 lore raw
Quoted 4 lines

But, why turning off DMA 'hdparm -d0 /dev/hdd' then everything
work fine? Do you mean if turning off DMA then 2.4 kernel also knows that errors in the last few blocks of an ISO image are not in fact to be counted as errors and retried? Also Jens knows?

No idea. I'd venture the IDE DMA error recovery is broken in the 2.4 tree. Andre has implied that is the case but since he's having a silly fight with Linus someone else will have to fix it.

So long as it works in 2.2 I'm not worried. I'm not 2.4 maintainer 8)

Alan