Recording a CD under Linux

CD/DVD Creator

Our current Centos install should detect when a CDR/CDRW/DVDRW is inserted, allowing you to use the graphical CD/DVD creator tool to add files to a writeable disk. The rest of the information on this page may be somewhat depracated for the normal needs of most users.

Creating a CD image


Before being able to write to a CD, it is recommended that you create an image of CD prior to burning it to CD. You should ideally create the CD image on a disk which is local to the machine (e.g. on the /data/private partition) - not only is a CD image likely to be very large and not fit within you disk quota, but also the file server can at times run slowly which may result in CDs being incorrectly written.

To create a CD image, you will need to use the mkisofs tool. You should first put all the files and directorys you want to be on the CD in one directory. Then run mkisofs to create the disk image:
    mkisofs -r -o CDIMAGE SOURCEDIR/
Where CDIMAGE is the name of the file that will become your CD image and SOURCEDIR is the directory containing the data you wish to be stored on the CD. The contents of this folder will be the root (or top level) of your CD.

If you have files which are not in "DOS 8.3" format (e.g. filename.exe), you may get warnings and are informed of a substitute filename. This can safely be ignored as modern operating systems are able to access the full filename.

The -r option to mkisofs ensures that all files on the CD are readable by all users. More information on the options available to mkisofs are listed in the man page.

If you are going to be creating a DVD, then it is not nescessary (though advisable) to create an ISO image of the disk - see the section below for more information.

Burning the image to CD

Once a CD image has been created, you need to burn it to a blank disk. When you insert a blank disk into one of the Linux machines, Nautilus (the file manager) will pop up a window with the title "burn:///" - you should close this window as it tries to create an image of the CD you are going to burn within your home directory!

To burn the CD, you need to use the tool cdrecord. man cdrecord or cdrecord -help give details of how to use it. When using the cd writers installed on the multimedia machines in UG04, the following is the recommended way of writing an image to disk:
    cdrecord -v speed=16 dev=ATAPI:0,0,0 driveropts=burnfree -data CDIMAGE
where CDIMAGE is name of the disk image you have already prepared.

Using these options sets the recording speed to 16x and tells the CD drives to enable a technology designed to help reduce problems when writing to the disk.

Important note: If your CD image is greater than 650Mb (e.g. a DVD image), then you will not be able to use cdrecord. See the notes below on burning a DVD image.

Burning a DVD image (> 650Mb)

If your iso file is larger than 650Mb, then you will not be able to burn the image to a DVD using cdrecord. Instead you must use the growisofs command.

If you have already created an ISO image, you should use the following command to burn it to disk:
    growisofs -Z /dev/scd0=PATH/TO/IMAGE.iso
substitute PATH/TO/IMAGE.iso with the path to your image. You may wish to try adding the -dry-run option which will do a test burn of the image without actually enabling the laser on the drive. It is strongly recommended that you use this first before actually burning the disk.

When using growisofs, it is possible to burn a DVD without first creating an ISO image. The following command would do this:
    growisofs -Z /dev/scd0 -R -J /PATH/TO/FILES
For more information on using this, you should read the man-page for growisofs.

Further Information

More detailed information can be found in the CD Writing Howto.

If running CD record on your own Linux machine at home, you will need to determine the device which the cd-writer appears as. Running cdrecord -scanbus will list any detected cd-writers and the device id used for the dev= parameter to cdrecord is listed in the first column of output.

If you installed the CD-writer after installing Linux or if your CD-writer is not detected, you may need to setup ide-scsi. Information on this can be found in the CD Writing Howto.