Linux CDR Example

If you're unfamiliar with Linux CD-R burning, the gentlest introduction is usually to try a GUI tool. Here is how to do the job using X-CD-Roast:

1. Start the program by typing xcdroast in an xterm window or by selecting the program from a desktop environment menu.

Note The first time you start X-CD-Roast, it may inform you that you lack sufficient privileges. If so, start the program as root, click Setup, click the Users tab, and ensure that Allow All is selected in the Access by Users area (alternatively, add specific users who should be given CD-R writing privileges to the list). Click Change Non-root Configuration and confirm that you want to enable non-root mode. After you quit, ordinary users should be able to run X-CD-Roast.

2. Click the Create CD button in the main window.

3. Click the Master Tracks button. The result is the X-CD-Roast track-mastering window, shown in Figure 2.2.

Figure 2.2: X-CD-Roast provides GUI tools for specifying what files to include on a CD-R.

4. Add files and directories to the file list. Do this by selecting the files or directories you want to add in the File/Directory View pane and clicking Add. X-CD-Roast will ask what part of the path to the files or directories you want to keep. Make a selection and click OK. Your selection will appear in the Session View pane.

5. Click the Create Session/Image tab, which brings up the display shown in Figure 2.3. Check in the New Session Size field in the Session Information area to be sure you haven't exceeded the capacity of your media. If you have, go back and remove files.

Figure 2.3: Additional CD-R creation options are available on additional program tabs.

6. Click the ISO-9660 Options tab in the main window. This action displays a large number of options you can set. The defaults are usually fine, but you should be sure that both the Joliet Extension (for Windows) and Rock Ridge (Anonymous) options are selected. You may also want to check the options on the ISO-9660 Header tab, in which you can set a volume title and similar information.

7. From the Create Session/Image tab (see Figure 2.3), Click the Master and Write On-the-Fly button. The program displays a dialog box asking for confirmation that you're ready to continue. If you haven't already inserted a blank CD-R in your drive, do so, and then click OK. The program displays a progress dialog box summarizing the burn operation.

Note You may need to adjust the permissions on your CD-R device file to use a GUI CD-R package. Alternatively, you can set the set-user-ID (SUID) and set-group-ID (SGID) bits on the cdrecord binary. For instance, asroot, type chmod 6755 /usr/bin/cdrecord to give all users access tocdrecord, including root privileges while running it. Change6755 to 6750 to limit access to those users who belong to whatever group owns cdrecord.

There are many additional options in X-CD-Roast, of course. For instance, you can create a bootable CD-R by using the Boot Options tab (shown in Figures 2.2 and 2.3), selecting the El Torito (for IA-32) or Sparc (for Sun workstations) option, and entering the path to a bootable floppy disk image in the Boot Image field. You can create audio CD-Rs by placing .wav or other supported audio files in the temporary storage directory (specified from the setup area's HD Settings tab; typically /tmp). Click Write Tracks and use the Layout Tracks tab to select which audio files you want to burn and in what order. You can also burn an existing image file in much the same way—copy the file to the temporary storage directory and tell X-CD-Roast to copy it using the Write Tracks option.

Despite their wide range of options, X-CD-Roast and other GUI tools aren't always the best way to create a CD-R. Sometimes, the command-line tools are the solution. To create an image file, you use the mkisofs command:

$ mkisofs -J -r -V "volume name" -o ..¡image.iso .1

This command creates an image file called image.iso in the parent of the current directory, using the contents of the current working directory (./) as the image contents. The -J and -r options enable Joliet and Rock Ridge extensions, respectively, and the -V option sets the volume name to whatever you specify. Dozens of other options and variants on these are available; check the mkisofs man page for details.

Once you've created an image file, you can burn it with a command such as the following:

$ cdrecord dev=0,4,0 speed=2 ..Iimage.iso

In this example, dev=0,4,0 option specifies that SCSI host adapter 0 is used, burning to the CD-R drive on SCSI ID 4, with logical unit (LUN) 0. The speed is set using the speed option, and the final parameter specifies the source of the file to be burned. As with mkisofs, cdrecord supports many additional options; consult its man page for details. If the SUID bit isn't set on this program, with ownership set to root, you must run it as root.

Tip You can use the loopback option to verify the contents of an image file before burning it. For instance, typing mount -t iso9660 -o loop image.iso /mnt/cdrom mounts the image.iso file to /mnt/cdrom. You can then check that all the files that should be present are present. You must be root to use this option, or you must have created an appropriate /etc/fstab entry.

0 0

Post a comment