Burning CDs and DVDs in Fedora Core Linux

 < Day Day Up > 

Burning (or creating) your own CDs is a fundamental skill for Linux multimedia enthusiasts. The CD and DVD (digital versatile disc) have become the standard media for multimedia content because of the increasingly larger size of typical media files. (Individual songs, even in compressed audio format, usually require several megabytes of storage space.) You can use CDs to

  • Record and store multimedia data, such as backup files, graphics images, and music, on a CD.

  • Rip audio tracks from a music CD (ripping refers to extracting music tracks from a music CD) and compile your own music CD for your personal use.

Linux audio clients and programs support the creation and use of many different types of audio formats. Later sections of this chapter discuss sound formats, sound cards, music players, and much more. Because CD burning is used for many other purposes in Fedora, we cover the essentials of that process first in this chapter. To record multimedia data on a CD, you must have installed a drive with CD writing capabilities on your system. Chapter 4, "Post-Installation Configuration," explains the rudiments of getting a CD writer configured and working properly. The hardware should have been set up properly during the initial Fedora installation or configured properly when detected by Kudzu. To make certain that your CD writer is working, use cdrecord -scanbus to get the information for using the CD drive under SCSI (small computer system interface) emulation:

 # cdrecord -scanbus Cdrecord-Clone 2.01a32-dvd (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jörg Schilling Linux sg driver version: 3.5.27 Using libscg version 'schily-0.8' scsibus0:         0,0,0     0) 'HL-DT-ST' 'RW/DVD GCC-4120B' '2.01' 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) * 

Here, we see that the CD writer (in this example, a CD writer/DVD reader) is present and is known by the system as device 0,0,0. The numbers represent the scsibus/target/lun (logical unit number) of the device. You will need to know this device number when you burn the CD, so write it down or remember it.

TIP

An IDE drive used to create CDs and DVDs needs to be emulated as a SCSI drive. Fedora does this automatically when you first install it, but in case you need to do it manually, here are the few items you need to configure (assuming that the CD drive is at /dev/hdd):

  • Add the following line to the /etc/modules.conf file:

     probeall ide-scsi 

  • Edit the /boot/grub/menu.lst file to add the following to the kernel commands:

     hdd=ide-scsi 

  • Reboot your computer.

These items will load the appropriate modules and provide SCSI emulation. You would no longer refer to the CD drive as /dev/hdd, but as /dev/scd0. Check the symbolic for /dev/cdrom to make certain that it points to /dev/scd0.

However, because Fedora now uses the 2.6 kernel, SCSI emulation is not necessary, although it is useful information should something not work correctly.


Creating CDs from the Command Line

In Linux, creating a CD is a two-step process. You first create the iso9660-formatted image, and you then burn or write the image onto the CD. The iso9660, as you will learn in Chapter 37, "Managing the File System," is the default file system for CD-ROMs.

Use the mkisofs command to create the ISO image. The mkisofs command has many options (see the man page for a full listing), but use the following for quick burns:

 $ mkisofs -r -v -J -l -o /tmp/our_special_cd.iso /source_directory 

The options used in this example are as follows:

-r Sets the permission of the files to more useful values. UID and GID (individual and group user ID requirements) are set to zero, all files are globally readable and searchable, and all files are set as executable (for Windows systems).

-v Displays verbose messages (rather than terse messages) so that you can see what is occurring during the process; these messages can help you resolve problems if they occur.

-J Uses the Joliet extensions to ISO9660 so that our Windows-using buddies can more easily read the CD. The Joliet (for Windows), Rock Ridge (for Unix), and HSF (for Mac) extensions to the iso9660 standard are used to accommodate long filenames rather than the eight-character DOS filenames that the iso9660 standard supports.

-l Allows 31 character filenames; DOS will not like it, but everyone else does.

-o Defines the directory where the image will be written (that is, the output) and its name. The /tmp directory is convenient for this purpose, but the image could go anywhere you have write permissions.

/source_directory Indicates the path to the source directory; that is, the directory containing the files we want to include. There are ways to append additional paths and exclude directories (and files) under the specified path it is all explained in the man page if you need that level of complexity. Our simple solution is to construct a new directory tree and populate it with the files we want to copy, and then make the image using that directory as the source.

Many more options are available, including options to make the CD bootable.

After you have created the ISO image, you can write it to the CD with the cdrecord command:

 $ cdrecord -eject -v speed=12 dev=0,0,0 /tmp/our_special_cd.iso 

The options used in this example are as follows:

-eject Ejects the CD when the write operation is finished.

-v Displays verbose messages.

speed= Sets the speed; the rate depends on the individual drive's capabilities. If the drive or the recordable medium is poor, you can use lower speeds to get a good burn.

dev= Specifies the device number of the CD writer (the number I told you to write down earlier).

NOTE

You can also use the blank= option with the cdrecord command to erase CD-RW disks. The cdrecord command has fewer options than does mkisofs, but it offers the -multi option, which enables you to make multi-session CDs. A multi-session CD enables you to write a data track, quit, and then add more data to the CD later. A single session CD can be written to only once; any leftover CD capacity is wasted. Read about other options in the cdrecord man page.

Current capacity for CD media is 700MB of data or 80 minutes of music. (There are 800MB/90-minute CDs, but they are rare.) Some CDs can be overburned; that is, recorded to a capacity in excess of the standard. The cdrecord command is capable of overburning if your CD-RW drive supports it. You can learn more about overburning CDs at http://www.cdmediaworld.com/hardware/cdrom/cd_oversize.shtml/.


Creating DVDs from the Command Line

There are several competing formats for DVD (Digital Versatile Disk), and with prices rapidly falling, it is more likely that DVD-writing drives will become commonplace. The formats are as follows:

DVD+R

DVD-R

DVD+RW

DVD-RW

Differences in the + and formats have mostly to do with how the data is modulated onto the DVD itself with the + format having an edge in buffer underrun recovery. How this is achieved impacts the playability of the newly created DVD on any DVD player. The DVD+ format also has some advantages in recording on scratched or dirty media. Most drives support the DVD+ format. As with any relatively new technology, your mileage may vary.

We will focus on the DVD+RW drives because most drives sold support that standard. The software supplied with Fedora Core has support for writing to DVD-R/W (re-writable) media as well. It will be useful for you to review the DVD+RW/+R/-R[W] for Linux HOWTO at http://fy.chalmers.se/~appro/linux/DVD+RW/ before attempting to use the dvd+rw-tools that you will need to install to enable DVD creation (also known as "mastering") as well as the cdrtools package. You can ignore the discussion in the HOWTO about kernel patches, compiling the tools.

TIP

The 4.7GB size of DVD media is measured as 1000 megabytes per gigabyte, instead of the more commonly used 1024 megabytes per gigabyte, so don't be surprised when the actual formatted capacity, about 4.4GB, is less than you anticipated. The dvd+rw-tools will not allow you to exceed the capacity of the disk.


You need to have the dvd+rw-tools package installed (as well as the cdrtools package). The dvd+rw-tools package contains the growisofs application (that acts as a front end to mkisofs) as well as the DVD formatting utility.

You can use DVD media to record data in two ways. The first way is much the same as that used to record CDs in a "session," and the second way is to record the data as a true file system using packet writing.

Session Writing

To record data in a session, you use a two-phase process:

  • Format the disk with dvd+rw-format /dev/scd0 (only necessary the first time you use a disk).

  • Write your data to the disk with growisofs -Z /dev/scd0 -R -J /your_files.

The growisofs command simply streams the data to the disk. For subsequent sessions, use the -M argument instead of Z. The -Z argument is used only for the initial session recording; if you use the -Z argument on an already used disk, it simply erases the existing files.

CAUTION

Some DVDs come preformatted; formatting them again when you use them for the first time can make the DVD useless. Always be sure to carefully read the packaging your DVD comes in to ensure that you are not about to create another coaster!


TIP

Writing a first session of at least 1GB helps maintain compatibility of your recorded data with other optical drives. This is because the DVD players calibrate themselves by attempting to read from specific locations on the disk; you need data there for the drive to read it and calibrate itself.

Also, because of limitations to the ISO9660 file system in Linux, do not start new sessions of a multi-session DVD that would create a directory past the 4GB boundary. If you do so, it will cause the offsets used to point to the files to "wrap around" and point to the wrong files.


Packet Writing

Packet writing treats the DVD disk like a hard drive in which you create a file system (like ext3) and "format" the disk, and then write to it randomly like a conventional hard drive. This method, although commonly available on MS Windows-based computers, is still experimental for Linux and is not yet covered in detail here.

TIP

DVD+RW media are capable of only about 1,000 writes, so it is very useful to mount them with the noatime option to eliminate any writing to update their inodes or simply mount them read-only when it's not necessary to write to them.


It is possible to pipe data to the growisofs command:

 # your_application | growisofs -Z /dev/scd0=/dev/fd/0 

It's also possible to burn from an existing image (or file, named pipe, or device):

 # growisofs -Z /dev/scd0=image 

The dvd+rw-tools documentation, found at /usr/share/doc/dvd+rw-tools-*/index.html, is required reading before your first use of the program. We also suggest that you experiment with DVD-RW (re-writable) media first, as DVD-R (record once) media is not yet as inexpensive as CD-R media.

Currently, there are no GUI clients for DVD creation, so all your DVD work will be done at the command line. We suggest that you practice with a re-writable DVD because of the expense of DVD disks.

Creating CDs with Fedora's Graphical Clients

Although adequate for quick burns and use in shell scripting, the command-line technique for burning CDs is an awkward choice for many people until they become proficient at it and learn all the arcane commands. Fortunately, Fedora provides several graphical clients.

With Fedora, enhanced functionality has been included in the default file browser Nautilus. Under the Places menu item is a CD Creator selection. To use it, insert a blank CD into your CD-RW drive. You will need to have two Nautilus windows open: one showing the files you want to save to the CD, and a second one that is opened to the burn:/// location. Click on the Write CD button as shown in Figure 10.1 to bring up the Write dialog; click on the Write files to CD button to actually create the CD. It is that simple, or it should be. There are some reports of difficulty with Nautilus being able to burn CDs.

Figure 10.1. Creating a CD using the Nautilus browser is made easy with the drag-and-drop features it provides.


The following sections describe X-CD-Roast, as well as a number of other graphical clients for burning audio and data CDs.

TIP

An excellent Internet site for CD-related information is http://www.cdmediaworld.com/.

Also, the Gracenote CDDB Music Recognition Service licenses a database service to software developers so that they can include additional functionality in their application by accessing the database and having their application display information about the music CD, including the artist and song title, the CD's track list, and so on. The database server at cddb.cddb.org will, when contacted by the appropriate software, identify the appropriate CD and send the information to be displayed locally. Many CD player applications provide this functionality. The service is interactive: If you have a CD that is not in the CDDB database, the website tells you how you can add the information to the database.


Each GUI application for burning CDs has different strengths and weaknesses. You should experiment with all the different graphical tools as well as try your hand at command-line burning and you will have a significantly richer multimedia experience with Fedora.

X-CD-Roast

X-CD-Roast, shown in Figure 10.2, is the default standalone CD creator provided with Fedora Core Linux. It can be found in the System Tools menu as the CD Writer menu item, or it can be launched from the command line, like this:

 $ xcdroast & 

Figure 10.2. X-CD-Roast is the default CD creation client for Fedora, and it must be configured from the Setup dialog.


When you first start it, X-CD-Roast is deceptively plain, giving little indication of the true power of this application. The very first time it is run, it begins with a dialog warning you to enter the Setup dialog, which will be the only button presented to you in the next screen other than Exit. The application autodetects your CD drive, but you must tell it which drive (if you have more than one) is the CD-RW drive and select the users who are allowed to use the application. The dialogs for setting this information are straightforward and easy to follow. Make certain that you choose a default directory for temporary image storage that offers enough room to store several images.

The main X-CD-Roast menu offers you the choice to duplicate or create CDs. The latter operation is shown in Figure 10.3.

Figure 10.3. The X-CD-Roast Create CD window allows access to the full range of options, including creating music CDs.


Other Graphical CD Clients

Fedora provides the GNOME Grip client to advance ripping to a fine art. Working as both a player and a ripper, it uses cdparanoia and cdda2wav to rip music tracks and access Internet databases for retrieving track information from disc database servers. To launch Grip, click on its icon in the Sound & Video menu found in the More Sound & Video Applications menu. Use the options in the Grip dialog box tabs to choose, configure, and rip tracks. Also provided is the similar Sound Juicer application.

     < Day Day Up > 


    Red Hat Fedora 4 Unleashed
    Red Hat Fedora 4 Unleashed
    ISBN: 0672327929
    EAN: 2147483647
    Year: 2006
    Pages: 361

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net