Tech > CdBurning

CD Burning Hints and Tips

Useful Commands

Create an iso file from an existing CD

Note: It would appear mkisofs has been replaced by a fork. Debian 5.0 (Lenny) now uses genisoimage instead.

# dd if=/dev/cdrom of=knoppix.iso

or

# mkisofs -r -J -A "Example" -o my.iso /mnt/cdrom

Create ISO file

# mkisofs -r -A "Example" -o my.iso /home/myfiles

or with Joliet long file name support for Windows

# mkisofs -r -J -A "Example" -o my.iso /home/myfiles

Windows support

Long filenames

Works with very long filenames, but breachs standards and still doesn't work great under Windows

# mkisofs -T -r --max-iso9660-filenames -A "My CD" -o my.iso /home/me/mycd

The following seems to work OK with Windows XP

  $ mkisofs -iso-level 2 -J -joliet-long -l -D -relaxed-filenames -N -o my.iso /home/me/mycd

Mounting an ISO file

  # mount -t iso9660 -o ro,loop=/dev/loop0 my.iso /mnt/cdrom2

Which device is my CD recorder

# cdrecord -scanbus to get dev=?,?,?

or

$ wodim --devices

If this doesn't list any cd devices, your cd device is probably IDE. You need to enable scsi emulation by changing your kernel boot parameters to include 'hdc=ide-scsi'. Change hdc to whatever your cd device is. (Kernel 2.4.28 accepts 'hdc=scsi' - maybe both are supported).

E.g. lilo

image=/boot/vmlinuz-2.4.28
   label="linux"
   root=/dev/hda1
   append="hdc=scsi"

You'll also need to load the following module.

  • insmod ide-scsi

You can add this to /etc/modules to have it loaded on boot. I believe maintenance of /etc/modules differs between distributions.

Note: Having specified scsi emulation to the kernel boot parameters, the drive letter for accessing your cdrom will have changed to something like /dev/scd0 depending on your hardware configuration. 'cat /proc/scsi/scsi' will help you figure out what the drive letter should be. You can either specify the complete mount command or amend /etc/fstab to use the new drive letter. If you're using a symbolic link for your cdrom you'll need to change that too.

On Debian Woody /usr/share/doc/cdrecord/README.ATAPI is full of usefull hints.

Kernel 2.6 doesn't need the hdc=scsi kernel parameters.

For a list of supported transport layers on your platform:

  • cdrecord dev=HELP:

Also try specifying the transport layer when using scanbus:

  • cdrecord dev=ATAPI: -scanbus
  • cdrecord dev=OLDATAPI: -scanbus

Try ejecting the cd:

  • cdrecord dev=ATAPI:0,1,0 -eject

What capabilities does my drive have?

  • cdrecord -prcap

Copy CD

Note: The disk.toc file is created during the read operation. It will also be created for you when using the copy command (during it's read operation).

Create image file of CD

  • cdrdao read-cd --driver generic-mmc --device 0,0,0 --datafile disk.bin disk.toc

Write CD from image

  • cdrdao write --driver generic-mmc --device 0,0,0 disk.toc

Copy CD

  • cdrdao copy --driver generic-mmc --device 0,0,0 --eject disk.toc

or

  • cdrdao copy --source-driver generic-mmc --source-device 0,0,0 --driver generic-mmc --device 0,1,0 --eject disk.toc

or

  • cdrdao copy --source-driver generic-mmc --source-device ATA:1,0,0 --driver generic-mmc --device ATA:1,1,0 --eject disk.toc

Test burn

# cdrecord -v -dummy speed=48 dev=0,1,0 -data my.iso

Burn and eject

# cdrecord -v -eject dev=0,1,0 -data my.iso

or

$ wodim -v -eject dev='/dev/scd0' -data my.iso

Blanking CDRW

# cdrecord blank=fast -v -dummy speed=48 dev=0,1,0 -eject -data some.iso

Create WAV files from cdrom

# cdparanoia -vw -B

# cdparanoia -B

dvd rom drive, tracks 2 to 3 inclusive

# cdparanoia -d /dev/cdrom1 -B "2-3"

Alternatively use the excellent command line based, script abcde which supports output in many different formats. It also fills in id3 tag information from databases like [CDDB](https://en.wikipedia.org/wiki/CDDB].

Rip the CD into a single FLAC file as a backup:

$ abcde -1 -o flac -a default,getalbumart,cue

Subsequently, create m4a files from the flac file:

$ abcde -o m4a -a cddb,getalbumart,playlist,move,clean -d flac-file.flac

See also a Command-Line Guide to Audio Files in Ubuntu

-- Frank Dean - 28 Jun 2017


Burning Audio CD

# cdrecord -v gracetime=2 dev=0,1,0 speed=48 -dao driveropts=burnfree -eject -useinfo -text -audio /tmp/kde-frank/k3b-audio_0_01.inf /tmp/kde-frank/k3b-audio_0_02.inf ...

xcdroast seems the most popular GUI for burning


Burning a Multi-Session CD

This is not straight-forward and requires a little interaction between mkisofs and cdrecord. See the README.multi that comes with the cdrecord distribution. Also refer to the CD Writing HOWTO

Once you've figured out how to do it, the following will server as a reminder.

Initial Session

Make the iso file system with mkisofs as normal. Burn the CD with the -multi option:

  • cdrecord -v dev=0,1,0 -multi -data session1.iso

Further sessions

Create the iso file system incorporating input from the existing CD.

  • mkisofs -r -C cdrecord dev=0,1,0 -msinfo -M 0,1,0 -o session2.iso /home/myfiles

Then burn the CD as normal. Include the -multi option if you want to add further sessions in the future. Omit the -multi option to close the CD off. No further sessions can be added.

Testing whether CD is multi-session

Using the -msinfo option gives an error if the CD is not multi-session. If it is, you get the track start and finish info. E.g. '17097,29699'

* cdrecord dev=0,1,0 -msinfo

Mixed Audio and Data Sessions

As most audio cd players can only read the first sesiosn of a mutli-session CD, we can hide the data track(s) by writing them on the second session.

First Session - Audio

  • cdrecord dev=0,1,0 driveropts=burnfree -multi -pad -audio my.wav

Create ISO

  • mkisofs -r -C cdrecord dev=0,1,0 -msinfo -M 0,1,0 -o session2.iso /home/myfiles

Any problems try;

  • NEXT_TRACK=cdrecord -msinfo dev=0,1,0

  • mkisofs -r -C $NEXT_TRACK -o session2.iso /home/myfiles

Create Data Session

  • cdrecord -v dev=0,1,0 -data session2.iso

Use the -multi flag if you plan to write more data sessions.


Ripping Audio CDs

From the cdrecord man pages...

...

To copy an audio CD in the most accurate way, first run

  • cdda2wav dev=/dev/cdrom1 -vall cddb=0 -B -Owav

and then run

  • cdrecord dev=/dev/cdrom1 -v -dao -useinfo -text *.wav

This will try copy track indices and to read CD-Text information from disk. If there is no CD-Text information, cdda2wav will try to get the information from freedb.org instead.

...

grip is a good GUI for ripping audio cds


Creating a live CD

Knoppix

The best live CD - based on Debian - Excellent hardware detection!

http://www.knopper.net/

http://www.knoppix.org/

Mandrake

Create a live CD based on an existing Mandrake installation. Details here

Available as a package for Mandrake 9.2 from the contrib section - mklivecd

Trouble-Shooting

wodim: No such file or directory

This occurs on Debian 6.0 (Squeeze) when using:

$ wodim --devices

It may also occur if you are not a member of the cdrom group.

/usr/share/doc/wodim/README.ATAPI.setup states that /dev/cdrw should be a symbolic link to the cd writer, so you may not need to list devices. I could only list devices using the old -scanbus option in combination with dev=OLDATAPI: e.g.

$ wodim dev=OLDATAPI: -scanbus

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597500

-- Frank Dean - 5 Apr 2011

Origami CD Case

References


-- Frank Dean - 15 Jul 2004

Related Topics: abcde, MusicEncoding