The UHF of the film world.
Tips on Burning cd's and dvd's under Linux

Question: What does the Sense key and codes mean?

This basically describes the error condition. Here we can see an example from cdrecord.
Sense Key: 0x3 Medium Error, Segment 0
Sense Code: 0x0C Qual 0x09 (write error - loss of streaming) Fru 0x0

This is an 03 / 0C / 09 error, and you see what it translates too.

If you can't find the error, I have a table listed of the latest published draft of the codes available at http://www.quietearth.us/sense-keys.php

Question: Why does my CD-R/CD-RW always fail to burn?

You might find that burning a cd-r or cd-rw at high speed will fail because the input buffer cannot keep up with it. This is why we need to turn burnfree on (in earlier versions of cdrecord it was burnproof). This will enable the drive to pause the laser while the the write buffer fills up.
# cdrecord dev=[DEVICE] -verbose driveropts=burnfree [iso image or options]

Here is an example error you might receive without using burnfree:
cdrecord: Input/output error. write_g1: scsi sendcmd: no error

CDB: 2A 00 00 05 7D 89 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0A 00 00 00 00 21 02 00 00 00 00
Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0
Sense flags: Blk 0 (not valid)
cmd finished after 0.000s timeout 40s

write track data: error after 736905216 bytes
cdrecord: The current problem looks like a buffer underrun.
cdrecord: Try to use 'driveropts=burnfree'.
cdrecord: Make sure that you are root, enable DMA and check your HW/OS set up.

cdrecord: Input/output error. test unit ready: scsi sendcmd: no error
CDB: 00 00 00 00 00 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 03 00 00 00 00 0A 00 00 00 00 0C 09 00 00 00 00
Sense Key: 0x3 Medium Error, Segment 0
Sense Code: 0x0C Qual 0x09 (write error - loss of streaming) Fru 0x0
Sense flags: Blk 0 (not valid)
cmd finished after 0.000s timeout 40s

Question: Why won't DVD+R burn under the 2.4 kernel?

Under the Linux 2.4 kernel, some drives have problems burning DVD+R discs (or maybe other media, but this is all I've seen). This happens due to the timeout in the kernel which is 45 seconds, this was upped to 60 seconds in the 2.6 kernel along with alot of other changes. The drive is still busy performing the OPC (optimum power calibration) operation, or the firmware just does not respond in time so the kernel times out before it can even start. I have also seen this cause drives to drop from DMA mode to PIO mode which is a severe decrease in speed. (More on DMA/PIO modes later). There are two ways around this
1. Change the timeout in your kernel to 60 seconds and recompile
2. Buy a new drive that can perform the opc operation in under 45 seconds, NEC is a good brand

Here is an example of the error you might see:
# growisofs -Z /dev/dvd=[isoimage] Executing 'builtin_dd if=/tmp/write.iso of=/dev/cdrom obs=32k'
 0/4700372992 ( 0.0%) @0.0x, remaining 281:11
 0/4700372992 ( 0.0%) @0.0x, remaining 492:05
 0/4700372992 ( 0.0%) @0.0x, remaining 702:59
 0/4700372992 ( 0.0%) @0.0x, remaining 984:11
 0/4700372992 ( 0.0%) @0.0x, remaining 1195:05
 0/4700372992 ( 0.0%) @0.0x, remaining 1405:58
 0/4700372992 ( 0.0%) @0.0x, remaining 1687:10
 0/4700372992 ( 0.0%) @0.0x, remaining 1898:04
 0/4700372992 ( 0.0%) @0.0x, remaining 2108:58
scsi : aborting command due to timeout : pid 356464, scsi2, channel 0, id 0, lun 0 Write (10) 00 00 00 02 20 00 00 10 00
hda: error waiting for DMA
hda: dma timeout retry: status=0xd0 { Busy }
hda: ATAPI reset complete
:-[ LBA=220h, SENSE KEY=5h/ASC=21h/ASCQ=2h ]
:-( write failed: Input/output error


Question: Why won't my drive burn this specific media type?

Each specific drive has it's own firmware, and in this firmware are the "write strategies" to tell it how to burn a specific type of media. If you have a burner that will do DVD+R at 8x, chances are it won't recognize a DVD+R rated at 16x.

Answer: Check with your drive manufacturer to see if they have newer firmware available. Otherwise you will need to buy supported media or a different drive.

Just because the media says "Memorex" does not mean that Memorex made it, and usually some company in Asia makes it, and HP, Memorex, Sony, or whomever just buys a lot and stamps their name on it.

In the following example, you will see the cdrecord command will give you CD-R/CD-RW media info. The "ATIP start of lead in/out" and "Manufacturer/Manuf Index" are used to identify the type of media.
# cdrecord dev=[DEVICE] -verbose -atip
[...cdrecord header cut out...]
ATIP info from disk:
Indicated writing power: 1
Reference speed: 0
Is not unrestricted
Is erasable
Disk sub type: Ultra High speed Rewritable media (2)
ATIP start of lead in: -11076 (97:34/24)
ATIP start of lead out: 336075 (74:43/00)
1T speed low: 16 1T speed high: 16
2T speed low: 8 2T speed high: 24
power mult factor: 4 5
recommended erase/write power: 1
A1 values: 66 4A 99
A2 values: 38 80 00
A3 values: 04 C4 A0
Disk type: Phase change
Manuf. index: 11
Manufacturer: Mitsubishi Chemical Corporation

In the following example, you will see the command "dvd+rw-mediainfo" which is part of the dvd+rw-tools distrubition. You can use this to identify the manufacturer and type of your dvd. You will see the "Media ID" is "CMC MAG/E01".
# dvd+rw-mediainfo /dev/dvd INQUIRY: [_NEC ][DVD_RW ND-3540A ][1.30]
GET [CURRENT] CONFIGURATION:
Mounted Media: 1Bh, DVD+R
Media ID: CMC MAG/E01
Current Write Speed: 6.1x1385=8467KB/s
Write Speed #0: 6.1x1385=8467KB/s
Write Speed #1: 5.1x1385=7056KB/s
Write Speed #2: 4.1x1385=5645KB/s
Write Speed #3: 3.1x1385=4234KB/s
Write Speed #4: 2.0x1385=2822KB/s
Write Speed #5: 1.0x1385=1411KB/s
GET [CURRENT] PERFORMANCE:
Write Performance: 4.0x1385=5540KB/s@[0 -> 442367]
6.0x1385=8310KB/s@[442368 -> 1155071]
8.0x1385=11080KB/s@[1155072 -> 2295104]
Speed Descriptor#0: 00/2295104 R@8.0x1385=11080KB/s W@8.0x1385=11080KB/s
Speed Descriptor#1: 00/2295104 R@8.0x1385=11080KB/s W@6.0x1385=8310KB/s
Speed Descriptor#2: 00/2295104 R@5.0x1385=6925KB/s W@4.0x1385=5540KB/s
Speed Descriptor#3: 00/2295104 R@5.0x1385=6925KB/s W@2.4x1385=3324KB/s
READ DVD STRUCTURE[#0h]:
Media Book Type: 01h, DVD-ROM book [revision 1]
Legacy lead-out at: 2295104*2KB=4700372992
READ DISC INFORMATION:
Disc status: complete
Number of Sessions: 1
State of Last Session: complete
Number of Tracks: 1
READ TRACK INFORMATION[#1]:
Track State: partial/complete
Track Start Address: 0*2KB
Free Blocks: 0*2KB
Track Size: 2295104*2KB
FABRICATED TOC:
Track#1 : 17@0
Track#AA : 17@2295104
Multi-session Info: #1@0
READ CAPACITY: 2295104*2048=4700372992

Question: Why does it write slow?

If you are using a regular ide drive (even with scsi emulation), you can use the hdparm command to check what more you are running in. If the using_dma parameter is not set, then you are running in PIO mode which is incredibly slow.

Answer: Try enabling DMA mode with "hdparm -d1 [device]", but if this hangs the box or doesn't work, you're out of luck.
# hdparm -v /dev/cdrom

/dev/cdrom:
IO_support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 1 (on)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 256 (on)

Question: What is the best quality media?

Answer: Taiyo Yuden and Verbatim. Alot of poor quality Taiyo Yuden fake's are produced, so the best place to buy from is http://www.supermediastore.com. Verbatim can be purchased in most stores.

Question: What is the safest way to label my discs?

Answer: There is no safest way. To make them last a long time, do not label them with anything, this means adhesive, marker, or anything. Just put them in a protective sleeve which is labeled and store them upright. Studies show that anything can degrade your disc overtime.

Question: Are cd/dvd's good for backing up data?

Answer: Well the simple answer is, NO. Optical media is just not reliable enough for backup. I would reccomend magnetic tapes, and even then make 2 copies of everything, one to store in another location. If you are going to use a cd or dvd to backup data, at least make 2 copies. Here's a link for further discussion:
http://diveintomark.org/archives/2006/05/08/backup

avatar

keeplerop (7 years ago) Reply

=


Leave a comment