Skip to content

CD Mastering

Table of Contents

  1. Requirements and Setup
    1. Hardware Enabling
    2. File System Support
    3. Device Nodes
    4. User Access
  2. Making an ISO-image from files on the harddisk
  3. Testing the contents of the ISO-image file on the harddisk
  4. Copying the ISO-image to the CD-R(W)
  5. Copying the CD to the harddisk as an ISO-image
  6. Checking Data and Source integrity
  7. Audio CD Mastering
  8. Video DVD Mastering
  9. Disc Labelling
  10. References

1. Requirements and Setup

1.1 Hardware Enabling

After having installed all your CD/DVD devices (and maybe a SCSI controller), first check that all of them are detected during the BIOS bootstrap process. If this is not the case, something is probably wrong with the IDE/SCSI cabling, power-supply, SCSI termination (if you use SCSI devices) or the BIOS settings. If something still doesn't work, check the manual that came with the device(s) and maybe do some googling. Also, don't forget to connect your soundcard with any one of your CD/DVD devices you wish to use for audio output.

Then check if all of your CD/DVD devices are detected during the Linux kernel bootstrap process:

dmesg | grep CD-ROM

Uniform CD-ROM driver Revision: 3.12
  Vendor: PLEXTOR   Model: CD-ROM PX-32TS    Rev: 1.02
  Type:   CD-ROM                             ANSI SCSI revision: 02
  Type:   CD-ROM                             ANSI SCSI revision: 02
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 1, lun 0
Attached scsi CD-ROM sr1 at scsi0, channel 0, id 2, lun 0

dmesg | grep DVD


hdc: Pioneer DVD-ROM ATAPIModel DVD-106S 012, ATAPI CD/DVD-ROM drive
hdc: ATAPI 40X DVD-ROM drive, 256kB Cache

If you don't see your ATAPI/IDE CD/DVD devices check that you have both the IDE/ATAPI block device and CD-ROM drivers (CONFIG_BLK_DEV_IDE=y and CONFIG_BLK_DEV_IDECD=y) in your Linux kernel configuration.

Or, if you (only) have SCSI CD/DVD devices check that you have the generic SCSI support driver (CONFIG_SCSI=y and CONFIG_CHR_DEV_SG=y) and make sure you've also selected the right low-level SCSI controller driver (which is CONFIG_SCSI_SYM53C8XX=y for _my_ situation).

Check if the Linux kernel sees your SCSI controller hardware and uses the appropriate SCSI driver:

dmesg | grep -i scsi

SCSI subsystem driver Revision: 1.00
sym53c860-0: restart (scsi reset).
scsi0 : sym53c8xx-1.7.3c-20010512
  Type:   CD-ROM                             ANSI SCSI revision: 02
  Type:   CD-ROM                             ANSI SCSI revision: 02
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 1, lun 0
Attached scsi CD-ROM sr1 at scsi0, channel 0, id 2, lun 0
sym53c860-0-<1,*>: FAST-20 SCSI 20.0 MB/s (50.0 ns, offset 8)
sr0: scsi-1 drive
sr1: scsi3-mmc drive: 6x/6x writer cd/rw xa/form2 cdda tray

If you have any SCSI CD/DVD devices you can also check if the generic SCSI driver in Linux sees them. Note the ID codes by which my SCSI CD-ROM and my SCSI CD-RW are addressed by programs, in this case "0,1,0" and "0,2,0".

cdrecord -scanbus

Linux sg driver version: 3.1.17
Using libscg version 'schily-0.5'
scsibus0:
        0,0,0     0) *
        0,1,0     1) 'PLEXTOR ' 'CD-ROM PX-32TS  ' '1.02' Removable CD-ROM
        0,2,0     2) 'RICOH   ' 'MP6200S         ' '2.20' Removable CD-ROM
        0,3,0     3) *
        0,4,0     4) *
        0,5,0     5) *
        0,6,0     6) *
        0,7,0     7) *

1.2 File System Support

You should at least have Linux kernel support for the ISO 9660 CD-ROM file system (CONFIG_ISO9660_FS=y).

If you want to read DVD's make sure you have UDF file system support in your Linux kernel (CONFIG_UDF_FS=y).

If you're also planning on burning DVD's make sure you have both the read and the (experimental) write driver for the UDF file system (CONFIG_UDF_FS=y and CONFIG_UDF_RW=y).

1.3 Device Nodes

As an optional (but recommended) step you can create symbolic links from the true Linux device node names of your CD/DVD devices to an easier to remember name.

In my CD/DVD setup I have: 1 SCSI CD-ROM, 1 SCSI CD-RW and 1 ATAPI DVD-ROM device. I'll respectivly want to refer to these devices by: /dev/cdrom, /dev/cdrw, /dev/dvd. To achieve this I issued the shell commands shown below. Note that some of the directories could already be existant on your system. To find out which device nodes under "/dev" are used by your CD/DVD devices, check your linux bootstrap with "dmesg | less". Another note: if you're using the new Linux device naming model called "devfs", you can skip this whole section.

ln -s /dev/sda1 /dev/cdrom
ln -s /dev/sda2 /dev/cdrw
ln -s /dev/hdc0 /dev/cdrom

To make the mounting/accessing/unmounting steps of devices even simpler, you can create short-named mount points. Note that it isn't a good idea to put these directories under /mount (as some OS'es do), because a wrong mount on /mount could block the other mount points under /mount.

mkdir /cdrom
mkdir /cdrw
mkdir /dvd

Then add some extra lines to you /etc/fstab file. See the manual page of mount for other options you can use in this file (or on the command-line).

# <file system> <mount point>   <type>  <options>               <dump> <pass>

/dev/cdrom      /cdrom        iso9660  defaults,ro,user,noauto   0       0
/dev/cdrw       /cdrw         iso9660  defaults,rw,user,noauto   0       0
/dev/dvd        /dvd          udf      defaults,ro,user,noauto   0       0

Mounting and unmounting devices is now very simple:

mount /dvd umount /dvd

1.4 User Access

If you want to give users (without root permissions) access to your CD/DVD devices, you should create some new system groups and permission settings for these devices.

addgroup cdrom
addgroup cdrw
addgroup dvd

Then change the group ownership on your CD/DVD devices:

chown :cdrom /dev/sda1 /cdrom
chown :cdrw  /dev/sda2 /cdrw
chown :dvd   /dev/hdc0 /dvd

Then change the groups read/write permissions on your CD/DVD devices:

chmod g+rw /dev/sda1 /cdrom
chmod g+rw /dev/sda2 /cdrw
chmod g+rw /dev/hdc0 /dvd

Then add any user to any of the three groups you just created. Note that the new group ID's only take effect upon the next login.

adduser alexander cdrom cdrw dvd


2. Making an ISO-image from files on the harddisk

Creating a Rock-Ridge ISO-image (with long filename support ofcourse) from a directory:

mkisofs -o my_cdrom.iso -l -R cd_dir

See the manual page of mkisofs for other options.


3. Testing the contents of the ISO-image file on the harddisk

mount my_cdrom.iso /cdrom -o loop -t iso9660

4. Copying the ISO-image to the CD-R(W)

nice --18 cdrecord -eject -v speed=2 dev=0,2,0 -data -pad my_cdrom.iso

See the manual page of cdrecord for other options.

Here's an example of a CD-ROM burning session:

TOC Type: 1 = CD-ROM
scsidev: '0,2,0'
scsibus: 0 target: 2 lun: 0
Linux sg driver version: 3.1.17
Using libscg version 'schily-0.1'
atapi: 0
Device type    : Removable CD-ROM
Version        : 2
Response Format: 2
Capabilities   : 
Vendor_info    : 'RICOH'
Identifikation : 'MP6200S'
Revision       : '2.20'
Device seems to be: Generic mmc CD-RW.
Using generic SCSI-3/mmc CD-R driver (mmc_cdr).
Driver flags   : SWABAUDIO
Drive buf size : 786432 = 768 KB
FIFO size      : 4194304 = 4096 KB
Track 01: data  459 MB         padsize:  30 KB
Total size:     527 MB (52:16.74) = 235256 sectors
Lout start:     528 MB (52:18/56) = 235256 sectors
Current Secsize: 2048
ATIP info from disk:
Indicated writing power: 4
Is not unrestricted
Is not erasable
ATIP start of lead in:  -11660 (97:26/40)
ATIP start of lead out: 336225 (74:45/00)
Disk type:    Long strategy type (Cyanine, AZO or similar)
Manuf. index: 6
Manufacturer: FUJI Photo Film Co., Ltd.
Blocks total: 336225 Blocks current: 336225 Blocks remaining: 100969
RBlocks total: 346210 RBlocks current: 346210 RBlocks remaining: 110954
Starting to write CD/DVD at speed 2 in write mode for single session.
Last chance to quit, starting real write in 1 seconds.
Waiting for reader process to fill input buffer ... input buffer ready.
Performing OPC...
Starting new track at sector: 0
Track 01: 459 of 459 MB written (fifo 100%).
Track 01: writing  30 KB of pad data.
Track 01: Total bytes read/written: 481769472/481800192 (235254 sectors).
Writing  time: 1583.935s
Fixating...
Fixating time:  134.600s
cdrecord: fifo had 7589 puts and 7589 gets.
cdrecord: fifo was 0 times empty and 7519 times full, min fill was 96%.

5. Copying the CD to the harddisk as an ISO-image

dd if=/dev/cdrom of=my_cdrom.iso

6. Checking Data and Source integrity of an ISO-image

Todo. (MD5 checksum)

Source authenticity checking can be done with PGP signature verification.

Todo. (gpg)


7. Audio CD Mastering

Todo. (cdrecord, jack, abcde, cdparanoia, ogg vorbis, cdda2wav, wav2cdr, cdrdao, cd-discid, cdindex/cddb, cdtool, cplay)

Convert an Audio CD into Ogg Vorbis files in one step:

Todo: abcde

Convert MP3 files into Audio CD format, and burn these in one step:

Note: do first a test with -d if needed!

mp3burn -t /tmp/ -c 70:00 -o "-eject -v speed=2 dev=0,2,0 -swab" file1.mp3 file2.mp3 file3.mp3 file4.mp3 file5.mp3 file6.mp3


8. Video CD/DVD Mastering

Todo. (transcode, mplayer, vcdimager, vcdtools)

References:
http://www.mplayerhq.hu/DOCS/encoding.html


9. Disc Labelling

Todo. (cdlabelgen, cd-circleprint, cdcover)


10. References

Sedo - Buy and Sell Domain Names and Websites project info: debianlinux.net Statistics for project debianlinux.net etracker® web controlling instead of log file analysis