There are two steps to burning a data CD-ROM. You need to create an ISO image with the mkisofs command and then burn the ISO image to the CD-ROM with the cdrecord command. The steps for burning a CD-R or a CD-RW are the same, except that if the CD-RW already has data on it, the CD-RW must be blanked before re-writing data to it.
Creating the ISO Image
Before you can burn a data CD-ROM, you have to create an ISO image of all the files that you want on the CD. The ISO images can not be larger than the size of the CD. Copy all the files that you want on the CD in a directory (files_dir in this example). Then run the following command the create the ISO image:
mkisofs -A “application id” -V “volume id” -J -R -v -T -x ./lost+found -o name.iso files_dir
||Volume header that describes the application the CD. The text string can not exceed 128 characters.|
||Volume ID, or volume label that is written to the master block.|
||Generate Joliet directory records so that MS Windows machines can read the CD properly.|
||Generate SUSP and RR records using the Rock Ridge protocol so that the CD can be read when mounted as an iso9660 filesystem, such as in Linux.|
||Verbose. This option allows you to follow the progress of the ISO image generation and allows you to see any errors that occur.|
||Specify directories to exclude from the ISO image, such as
||Specify the filename of the ISO image, such as
||The directory that contains the files to burn on the CD.|
For further information, read the mkisofs man page: man mkisofs.
Burning the ISO Image to a CD-R
If you have an IDE-CDR or IDE-CDRW device, you need to use the ide-scsi kernel module to emulate a SCSI host adapter for the IDE device. The easiest way to do this is to determine which device is the CD burner (/dev/hdd in this example) and tell the kernel to use the ide-scsi device driver for it when your computer boots. The latest versions of Red Hat Linux detect whether you have a CDR or CDRW device and set this option for you. It is set in your bootloader configuration file. If you are using LILO, modify /etc/lilo.conf to pass hdd=ide-scsi to the kernel as a kernel option:
Don’t forget to run the lilo command as root to enable the changes.
If you are using the GRUB bootloader, modify /boot/grub/grub.conf to pass hdd=ide-scsi to the kernel as a kernel option:
title Red Hat Linux (2.4.9-21)
kernel /vmlinuz-2.4.9-21 ro root=/dev/hda9 hdd=ide-scsi
If you modify the bootloader configuration file, the changes will not take effect until you reboot. To load the ide-scsi module manually, make sure no process is accessing the CDR or CDRW device, and unload the ide-cd module with the command rmmod ide-cd, and then load the ide-scsi module with the command modprobe ide-scsi.
If you have a SCSI CD burner, skip the ide-scsi steps and just make sure you can access the CD-ROM device.
You need to determine the SCSI address of the CD burner. As root, issue the command:
This will return something like:
Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jцrg Schilling
Linux sg driver version: 3.1.20
Using libscg version ‘schily-0.5′
0,0,0 0) ‘SONY ‘ ‘CD-R CDU928E ‘ ’1.1n’ Removable CD-ROM
0,1,0 1) *
0,2,0 2) *
0,3,0 3) *
0,4,0 4) *
0,5,0 5) *
0,6,0 6) *
0,7,0 7) *
Use the SCSI address with the cdrecord command to burn the ISO:
cdrecord –dev=0,0,0 name.iso
Burning the ISO Image to a CD-RW
To clear the contents of CD-RW:
cdrecord –dev=0,0,0 –blank=fast
Then, use the instructions for burning a CD-R.