[root@~]# cdrecord fs=16m speed=4 dev=/dev/cdrom -dao driveropts=burnfree -v -data -nopad file.iso

Burn iso into CD using cdrecord.






Burn data to CD

Creating an .iso file

Once you've selected the files you want to copy, writing to a CD consists of two steps: creating an .iso with mkisofs, then burning to disk with cdrecord. Use the following to create the .iso file:

mkisofs -o test.iso -J -r -v -V test_disk /home/carla/

In this example:

* -o names the new .iso image file (test.iso)
* -J uses Joliet naming records, for Windows compatibility
* -r uses Rock Ridge naming conventions for UNIX/Linux compatibility, and makes all files publicly readable
* -v sets verbose mode, for a running commentary as the image is created
* -V provides a volume ID (test_disk); this is the disk name that shows up in Windows Explorer
* Last in the list are the files selected for packaging into the .iso (everything in /home/carla/)

Now, mount the .iso for verification / Checking:

$ mkdir /test_iso
$ mount -t iso9660 -o ro,loop=/dev/loop0 test.iso /test_iso

Look at the directory contents; all your files should be there and readable. If they are not, the image is bad, and if you burn it onto a disk, you'll end up creating a coaster.

Burning the disk

Writing the image to disk is easy as pie. First find the SCSI address of your CD-R/RW:

cdrecord -scanbus

Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jrg Schilling
Linux sg driver version: 3.1.24
Using libscg version 'schily-0.5'
scsibus0:
0,0,0 0) 'TOSHIBA ' 'DVD-ROM SD-M1202' '1020' Removable CD-ROM
0,1,0 1) 'LITE-ON ' 'LTR-24102B ' '5S54' Removable CD-ROM
0,2,0 2) *
0,3,0 3) *
0,4,0 4) *
0,5,0 5) *
0,6,0 6) *
0,7,0 7) *
Now write to disk:

cdrecord -v -eject speed=8 dev=0,1,0 test.iso

In this example:

* -v is verbose
* -eject ejects the disk when finished
* -speed specifies write speed (8)
* -dev is the device number (0,1,0) obtained from cdrecord -scanbus
* Last is the name of the image being burned (test.iso)






Copy disk

To directly copy from the source disk to the recordable disk, use this command:

cdrecord -v dev=0,1,0 speed=4 -isosize /dev/scd0

OR

This command directly streams the contents of the CD-ROM, /dev/scd0, to the CD recorder, dev=0,1,0. Don't do this on an old, slow machine. Direct copying is fast, but more error-prone. It is better to first copy the source disk to a hard drive, then copy from the hard drive to the CD recorder:

mount /cdrom
dd if=/dev/scd0 of=/tmp/diskfile.iso
cdrecord dev=0,1,0 speed=8 fs=8m -v -eject -dummy /tmp/diskfile.iso

Notice a couple of new options, fs=8m and -dummy. fs=8m defines the size of the ring buffer: the bigger the better, up to a point. Remember, interruptions are fatal; fs=8m creates a large enough buffer to keep the recorder working if something slows down the data transfer. If 8 MB isn't enough, you might need a better PC. On the other hand, more than 8 MB is not necessarily better, as the operating system can waste time reloading the MMU (Memory Management Unit) tables. The default is 4 MB.

-dummy is a marvelous option for doing a dry run before risking an actual disk. The recorder does everything with the laser turned off, giving the user a chance to catch errors before committing them to disk.




Multisession

The first time you record a session on a disk, use the -multi switch in cdrecord:

cdrecord -v -eject speed=8 dev=0,1,0 -multi test.iso

The disk will be fixated in a manner that makes it readable and open for adding more data. To add more sessions to this disk, mkisofs needs to know the starting and ending sector numbers, which you can find like this:

cdrecord dev=0,1,0 -msinfo
0,27139

Be sure to have the disk you are adding data to in the CD recorder. Then add two new switches, -C and -M:

mkisofs -o test2.iso -J -r -V Session2 -C 0,27139 -M 0,1,0 /files/path/

Or better, let the command shell do the work:

$ mkisofs -o test2.iso -J -r -V Session2 -C `cdrecord dev=0,1,0 -msinfo` -M 0,1,0 /files/path/

Multisession CD drives read the last session written. This command takes the TOC from the last session and combines it into the new TOC. For the last session on the disk, omit the -multi option.

Resource : http://www.ibm.com/developerworks/linux/library/l-cdburn.html


Server is hosted by Alanstudio
Linux Operating System

Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.