CD Burning in Linux From the Command Line in CentOS 5 Linux
In this example I'm going to burn the contents of my public_html directory to a CD.

1. Navigate to the directory you'd like to copy to CD.

$ cd ~/public_html/

2. Make sure the contents of the directory do not exceed 650MB if you're burning to a CD, or 4.7GB if you're burning to DVD. In this example the output of running 'du -skh .' shows the directory contains 486MB of data.

$ du -skh .
486M .

3. Create an image file using 'mkisofs'

$ mkisofs -T -J -R -hfs -map /usr/local/lib/hfs.map -o /scratch/cd.img .

In the above command line, the only item you can change is 'cd.img' which is an arbitrary name I've chosen to name the image file. It is not necessary for you to change it. All the other arguments must be run exactly as shown including the trailing period. If a /scratch directory does not exist then choose another directory that has enough available space. Do not create the image file in the same directory you are trying to back up.
4. Now burn the image to disk.

$ cdrecord -v speed=16 dev=/dev/cdrw -dao /scratch/cd.img

If you have multiple CD drives, it might be /dev/cdrw1. A DVD writer might be /dev/dvdwriter.
5. Examine the CD for data integrity. If you're logged in at the console of your computer, eject the CD and reinsert it and it should automount for you.
6. Delete the disk image

$ /bin/rm -f /scratch/cd.img

 

Contact the Webmaster