Burning CDs and DVDs


Burning your own CDs is a fundamental skill for Linux multimedia enthusiasts. Compact discs and digital versatile discs (DVDs) are the standard media for multimedia data of all types because they are cheap to produce, ultra portable, and can hold the large files that carry audio, and especially video, signals. Even the standard three-minute pop song requires a few megabytes of space to store. For multimedia, you can use CD/DVDs to

  • Record, play, and store graphical images, music, video, and playlists

  • Rip audio tracks from your own music CDs and create "mix tapes" to your liking

Of course, CDs can store many other types of files, not only audio and visual files. They are an excellent medium for storing backups of all data stored on your hard drives. See Chapter 20, "Managing Data: Backup, Restoring, and Recovery," for more information.

It may be obvious to state, but if you want to record multimedia (and other) data on a CD, you must have a drive that supports writing data to discs. A simple CD-ROM player does just that plays already-recorded material that is read-only. What you need is a CD-RW (Read/Write) or DVD-RW/DVD+RW drive. The discs themselves must also be writable (CD-R or CD-RW and the corresponding DVD formats). YaST will configure your hardware at installation; see Chapter 4 to see how that is done. To ensure that your hardware is configured properly, use cdrecord -scanbus to get information on using the CD drive under SCSI emulation. When you type the following:

cdrecord -scanbus 

You should see something like this:

Cdrecord-Clone 2.01 (x86_64-suse-linux) Copyright (C) 1995-2004 Jörg Schilling Note: This version is an unofficial (modified) version Note: and therefore may have bugs that are not present in the original. Note: Please send bug reports or support requests to http://www.suse.de/feedback Note: The author of cdrecord should not be bothered with problems in this version. Linux sg driver version: 3.5.27 Using libscg version 'schily-0.8'. cdrecord: Warning: using inofficial libscg transport code version (okir@suse.de-scsi-linux-sg.c-1.83-resmgr-patch '@(#)scsi-linux-sg.c 1.83 04/05/20 Copyright 1997 J. Schilling'). scsibus0: 0,0,0 0) 'LITE-ON ' 'COMBO SOHC-5232K' 'NK07' 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) * scsibus2: 2,0,0 200) 'Memorex ' 'TD 2C ' '1.04' Removable Disk 2,1,0 201) * 2,2,0 202) * 2,3,0 203) * 2,4,0 204) * 2,5,0 205) * 2,6,0 206) * 2,7,0 207) * 

The CD writer 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 a CD from the command line, so write it down or remember it.

When you're first getting started with CD burning, it's good to have the comforting approach of a GUI wizard to walk you through the process. You can tackle the command-line approach eventually, but because SUSE Linux offers a pair of very good GUI tools for burning multimedia discs, you are indeed in good hands. In this section, you'll first learn about the CD creation tools that come with KDE and GNOME. Then you'll see the shell tools that let you burn at your keyboard.

Creating CDs and DVDs from Your Desktop

KDE's graphical CD/DVD "Kreator" is called K3b, and it makes CD burning pretty much a matter of dragging and dropping files into a project and going about your business.

Perhaps it's not quite that simple, but close enough for rock 'n' roll (or whatever style you prefer).

When you open K3b (see Figure 10.2), you see a familiar three-pane interface. On the upper left is your directory structure, with your last directory selected. In the upper right are the files contained in the selected directory. At the bottom is where the action happens. K3b offers four options in the main window:

Figure 10.2. K3b knows what the typical CD-burning projects are and puts them in easy reach on the main screen.


  • New Audio CD Project

  • New Data CD Project

  • New Data DVD Project

  • Copy CD

These items are not the only things you can do with K3b, but they are the most typical. Go to New Project in the File menu to see your other selections.

Tip

The Copy CD feature in K3b is pretty cool. Want a copy of a favorite CD to play in your car while the original sits in your home stereo? Put that CD in your computer's drive. Run K3b and choose Copy CD (you may have to turn off the default CD player first). K3b will first copy the tracks of the CD to a temporary directory on your hard drive. It will then prompt you to insert a writable CD and burn the tracks to the blank CD.


Let's make an audio CD. Click the appropriate button and the bottom pane effectively becomes a representation of your CD. Find your digital music files using the two upper panels, and drag the files you want to burn into the bottom pane. K3b should identify the track information from the tags included in every digital music file. If you don't see the title, artist, or other information for a track in the pane after you drag them in, select the track and click Query Cddb if you are online to check the CD Database, or type the information in yourself.

As you drag files into the bottom pane, the progress bar tells you how much room you have remaining on the disk. When you have dragged all the files you want (or have reached the end of the disc), you can rearrange them in any order you want. To create an ordered M3u playlist file for your MP3 audio files, click the Convert Audio Tracks icon from the toolbar and check the box. You can also use this dialog box to convert files from one audio format to another if you choose.

When all is well, and you have your tracks in order, click the Burn button on the toolbar. Another dialog box will appear. If you want to give your CD a title, click the Description tab in this dialog box. There are many settings available here, but accepting the defaults is the way to go for the novice. Click OK to start burning. A progress bar will appear to let you know how the burn is going. When the burn is complete, K3b will eject your new CD and play a happy bugle tune to announce its success. Your new CD will now play in any computer, stereo, or other CD player.

Burning CDs with Nautilus in GNOME

In GNOME, basic CD burning is built right in to the Nautilus file manager. Insert a blank CD in your CD-RW drive. Go to the Places menu in Nautilus and select CD/DVD Creator. Open a second (or more) Nautilus window(s) containing the files you want to burn to the CD. Drag and drop the files into the CD/DVD Creator window (which is really a special directory called burn:///).

When you have your files selected, select Write to Disc from the File menu in the CD/DVD Creator window. This opens a dialog box (see Figure 10.3) where you can name the CD. There are no special features for building multimedia collections (such as playlist orders), but if you just want to get some files (music or otherwise) onto a CD or DVD, Nautilus gives you the tool to do that.

Figure 10.3. Nautilus gives you a simple tool to create CDs.


Creating a CD from the Shell

Under the hood of the CD writing process, you'll find that this takes two steps. First, you create the iso9660-formatted image, and then you burn (or write) that image onto the CD. The iso9600 is the default file system for CD-ROMs.

Use the mkisofs command to create the ISO image. This 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

-r Sets the permission of the file 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 the 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 ISO9600 so that Windows can more easily read the CD. The Joliet (for Windows), Rock Ridge (for Unix), and HSF (for Mac) extensions to the ISO9600 standard are used to accommodate long filenames rather than the eight-character DOS filenames that the standard supports natively.

-l Allows 31-character filenames; plain 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 that you have room and write permissions.

/source_directory Indicates the path to the source directory that is, the directory containing the files you want to include on your CD. 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 granularity. 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

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

-v Displays verbose messages.

speed= Sets the speed; the rate depends on your drive's capabilities. If the drive or the disc itself does not support a faster speed (or burns poorly at the higher speed), you can use lower speeds to get a good burn.

dev= Specifies the device number of the CD writer (I told you that you'd need this).

Tip

If you have CD-RW (read/write) discs, you can use the cdrecord blank= option to erase all the existing files on the CD.

cdrecord also gives you the option (when the disc supports it) of making multisession CDs. Without this option, when you remove a CD from the drive after writing files to it, your disc can no longer be written to, even if it still has space available. Using cdrecord -multi gives you the choice to put more files on the disc later.

Current standard capacity for a CD is 700MB of data, or 80 minutes of music. Some CDs can be overburned; that is, recorded to a capacity higher than the standard. You can overburn with cdrecord as long as your drive supports it. Find out more at http://www.cdmediaworld.com/hardware/cdrom/cd_oversize.shtml.


Creating DVDs from the Shell

Many new computers now come with DVD-writing drives, and costs have come down to where ordinary users can buy them as well. Unfortunately, the standards-making bodies have not kept up with the increasing availability of these drives, so there are two competing formats for writing DVDs. Commonly known as the + and formats, DVD+R, DVD+RW, DVD-R, and DVD-RW are the ones we have to live with for now.

Differences between the two 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, and some support both.

This section will focus on the DVD+RW drives because most drives sold support this standard. The software supplied with SUSE Linux supports both formats. It will be useful to read the DVD-writing HOWTO at http://fy.chalmers.se/~appro/linux/DVD+RW before you use these command-line tools. You can skip over the part in the HOWTO with a detailed explanation of how things are done in the kernel to record DVDs. Read the stuff on the tools, though.

You need to have two packages installed to make DVD recording possible: dvd+rw tools and cdrtools. The dvd+rw tools package includes the growisofs application, which 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 is much the same as that used to record a CD in a "session," whereas 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 disc with dvd+rw-format /dev/scd0 (necessary only the first time you use a disk).

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

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

Caution

Some DVDs come preformatted. If this is the case and you format them again, the disc may become useless. Always be sure to read the fine print on the packaging on the DVD+RW before formatting.


Tip

When you write your first session on the DVD, cover at least one gigabyte (1GB). This helps ensure compatibility with other optical drives. DVD players calibrate themselves by attempting to read from specific locations on the disc. Data has to be present for the drive to read it and calibrate itself.

Also, because of limitations in the standard ISO9660 file system in Linux, do not start new sessions of a multisession DVD that would create a new directory past the 4GB boundary. If you do, 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 like a hard drive, where you create a file system (like ReiserFS) and "format" the disk. You can then write to it randomly as you would a hard drive. This method, although common on Windows computers, is still experimental for Linux and so is not covered in detail here.

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 in /usr/share/doc/dvd+rw-tools, is required reading before your first use of the program. Try experimenting with DVD-RW media first; DVD-R discs are not quite as cheap as CD-R disks, thus making the penalty for making mistakes somewhat higher.



SUSE Linux 10 Unleashed
SUSE Linux 10.0 Unleashed
ISBN: 0672327260
EAN: 2147483647
Year: 2003
Pages: 332

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