|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
|
| News | Recommended Links | Recommended Articles | CD creation with Nautilus | CD-based distributions | Humor | Etc |
|
About: ISO Master is an easy to use GUI CD image editor for Linux and BSD. Basically, you can use this program to extract files from an ISO, add files to an ISO, and create bootable ISOs, all in a graphical user interface. It can open both ISO and NRG files, but can only save as ISO. It is based on bkisofs, a library for reading, modifying, and writing ISO images.
Changes: This release adds Belarusian and Estonian translations. It fixes a couple of serious bugs to do with floppy emulation boot records and extracting files from very large images.
About: Asunder is a graphical audio CD ripper and encoder for Linux. You can use it to save tracks from an audio CD as WAV, MP3, OGG, and FLAC. It has CDDB support and can create M3U playlists. It's independent of any desktop environment. It can rip and encode at the same time. It aims to make CD ripping as quick and easy as possible.
Changes: This release adds Polish and Japanese translations. It adds BSD support. A serious bug that could cause encoding to stop working has been fixed. There are some usability improvements.
- MP3Trim
[homepage] freeware [download] (0.21)
- WavTrim
[homepage] freeware [download] (0.17)
- Quick Detox
[homepage] freeware [download] (.09)
About: ISO Master is an easy to use GUI CD image editor for Linux and BSD. Basically, you can use this program to extract files from an ISO, add files to an ISO, and create bootable ISOs, all in a graphical user interface. It can open both ISO and NRG files, but can only save as ISO. It is based on bkisofs, a library for reading, modifying, and writing ISO images. Changes: This release adds Hebrew and Indonesian translations, makes a few usability improvements, adds a couple of features, and fixes some minor bugs.
This cookbook is designed to help notebook users burn ISO images onto CDs and validate the contents.
While burning ISO images onto CDRs is a part of the Linux culture, not all of the distributions address validation of this process in the same manner. We need to burn ISO images with increasing regularity, and we may be burning them from a platform running Linux or the Solaris OS. So let's take a few minutes and review the process and see what we can do to validate the bits that actually make it to the optical disc.
The fundamental question is, how do you know your burn was successful?
The trivial answer would be, the exact same way you validate your ISO image download from the network, by using MD5 checksums. Unfortunately the answer is not quite as simple as that. In other words, a rather obscure problem might prevent you from validating a CDR in this manner, and it could leave you very frustrated.
First, here's an example where I am burning the Sun Java Desktop System beta documentation ISO image. The unimportant lines have been edited out for readability.
First, let's select a CD-RW device:
# cdrecord --scanbus Cdrecord 2.0 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling Linux sg driver version: 3.1.24 Using libscg version 'schily-0.7' scsibus2: 2,0,0 200) 'SONY ' 'DVD RW DRU-510A ' '1.0a' Removable CD-ROM 2,1,0 201) 'SAMSUNG ' 'CD-R/RW SW-248F ' 'R602' Removable CD-ROMNow, let's burn the ISO image to a CDR. Four important
cdrecordoptions can make your experience a lot more pleasurable.
speed=<n>: This will set the speed of the write. Unless forced,cdrecordwill limit this by the media speed, if it can be determined. In this example I am using 40x CDRs, and a 48x capable IDE writer.driveropts=burnfree: This enables buffer underrun protection. This is the most frequent cause of failed burns (which we affectionately call coasters). Most modern drives have a form of underrun protection and this command option enables support for it. Many other tools, such ascdrdao, enable burnfree by default;cdrecorddoes not.-dao: This tellscdrecordto write the disc in 'session at once' mode, sometimes called 'disc at once'. This will tell the laser to burn the lead out area so that no more data can be written to the device, effectively closing it permanently. Like burnfree, the default is not your favor, as we will see in a few minutes. For now, let's use-daoand see what happens.-eject: This will eject the CD-ROM media at the end of the write operation. If you forget to do this, you will not be able to calculate the correct MD5 checksum, and you will be left thinking you are having problems burning CDs.Time to burn the CD.
# cdrecord -v dev=2,1,0 speed=40 driveropts=burnfree -dao -eject MadHatter-Beta-Docs.iso Cdrecord 2.0 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling TOC Type: 1 = CD-ROM scsidev: '2,1,0' Starting to write CD/DVD at speed 40 in real SAO mode for single session. BURN-Free was 11 times used. cdrecord: fifo had 1760 puts and 1760 gets. cdrecord: fifo was 0 times empty and 911 times full, min fill was 95%.So now let's compare checksums.
# md5sum /dev/cdrom3 MadHatter-Beta-Docs.iso 8831242df75ea5bdc2c56e7f0e9830d3 /dev/cdrom3 8831242df75ea5bdc2c56e7f0e9830d3 MadHatter-Beta-Docs.isoOutstanding! No coaster.
So what's the big deal?
If I had not specified
-dao(session at once mode) and taken thecdrecorddefault recording mode (track at once), the following would have happened:# md5sum /dev/cdrom md5sum: /dev/cdrom: Input/output errorFurther stubborn attempts at verification might produce something like:
# dd if=/dev/cdrom bs=2048 | md5sum dd: reading `/dev/cdrom': Input/output error 269860+0 records in 269860+0 records out 7c996f932254bfae7a24a1fba14e57bb -And you would be convinced you had a coaster.
The problem is that the last block may be confused with the lead out area, and some drives will not read it properly. Thus your MD5 checksums will fail. You can pad the last blocks using the
-padoption ofcdrecord, but your checksums still might not match as you have added additional data to the CD that was not present in the original ISO image.Of course you could loopback mount the original ISO image, mount the newly burned CDR, and do something like this:
# mount -o ro,loop -t iso9660 `pwd`/MadHatter-Beta-Docs.iso /mnt # mount -o ro -t iso9660 /dev/cdrom /media/cdrom # diff -r /media/cdrom /mntIf nothing is reported, you are good to go. If you are doing this on a laptop with a single ATA drive and not much memory, you don't want to do this very often. It is a rather resource-intensive way of validating your ISO image. But then again, you may find the sound of popcorn popping in a microwave oven pleasurable.
So the moral of the story is to remember to pad the last block with
-pador better yet, write your CDRs in 'session at once' mode using-dao, and then usemd5sumto compare with the original ISO binary image.So far we have talked about Linux; what about the Solaris OS?
A patch (107645) for the Solaris 7 OS fixes the partial-last-block read problem. It was integrated into the Solaris 8 OS, so later releases do not have this particular problem.
As for MD5 checksums on the Solaris platform, find a copy of
gmd5sum(it is on the companion CD).One last note, make sure you enable DMA mode on your CD writer device. Most Linux distributions, including the Java Desktop System, turn DMA off by default. You can enable DMA via boot options, a Yast2 setting, or by the
DEVICES_FORCE_IDE_DMA_ONvariable in/etc/sysconfig/hardware.You can increase the responsiveness of a laptop by enabling 32-bit EIDE support and unmasking interrupts.
# hdparm -d1 -c1 -u1 /dev/hdcThis enables DMA and 32-bit EIDE support, and it allows disk interrupts to be interrupted.
Linux offers powerful, flexible tools for creating CDs. You can create disks that are readable on almost any platform and create .iso files for download and distribution.
Burning CDs from the command line on any platform can be mysterious and vexing, and this is certainly true on Linux. However, the commands and terminology are similar enough across platforms that it's useful to learn how to write CDs on Linux. A lot of Linux software is distributed via .iso images, so if you know how to burn your own CDs, you can download the .isos to create your own installation disks.
CD-writing programs are available for both Linux and Windows, but the Linux versions are more powerful and versatile than their Windows cousins. In this article, we'll look at
mkisofsandcdrecord, the workhorses of Linux CD recording.mkisofscreates a pre-mastered image, to generate an ISO9660/JOLIET/HFS hybrid filesystem. It both creates and populates a filesystem. Unlike other data storage media such as hard drives and floppy drives, a filesystem on CD is not first created, then populated with data. There is only one chance with a CD-R: formatting it first would create a disk with an empty filesystem.cdrecordrecords data on Orange Book CD-R/RWs, which is pretty much all of them.With newfangled technology like CD recording, newer versions of these programs are best.
mkisofsandcdrecordshould both be 1.10 or newer. The latest version ofcdrecord, version 2.0, has been renamedcdrtools. To find the versions installed on your machine, type:
$ cdrecord --versionand
$ mkisofs --versionFor those who are new to the world of recordable CDs, here are a few things worth knowing before we press on:
- CD-R: CD-Recordable. These are WORM (Write Once, Read Many).
- CD-RW: CD-Rewritable. These are WMRM (Write Many, Read Many).
- CD-Rs are universal and should be readable in any CD-ROM drive.
- CD-RWs should be readable in all contemporary drives. A drive must be "multiread" to be able to read CD-R and CD-RW disks. Older drives are troublesome. Retire that old 4x drive and buy a new one; it's not worth the irritation.
- Commercial CDs are pressed, not burned with a laser.
- Which CD-R/RW drives are best? Visit the usual hardware reviewers for advice.
And, a few terms related to file formats:
- Yellow Book: Physical format for data CDs
- Orange Book: Physical format for recordable CDs:
- Part I: CD-MO (Magneto-Optical)
- Part II: CD-WO (Write-Once; includes "hybrid" spec for PhotoCD)
- Part III: CD-RW (Re-writable)
- ISO-9660: The old file layout standard, allowing only 8.3 filenames
- Rock Ridge: Extensions to ISO-9660 allowing long filenames and UNIX-style symlinks; preserves all file attributes, such as ownership and permissions. UNIX file attributes are not displayed when the disk is read on a Windows system.
- Joliet: Microsoft extension to the ISO 9660 filesystem that allows Unicode characters to be used in filenames, as well as long filenames. It also creates truncated filenames for MS-DOS compatibility (these weird-looking things: FILENA~1.TXT). It allows filenames up to 64 characters, including spaces, and is readable by Windows 95 or later, and Macintosh computers running the Joliet Volume Access extension. Macs will not read Joliet file names longer than 31 characters.
- El Torito: Bootable CD-ROM format specification
- HFS (Hierarchical File System): Native file system used by Macintosh
- Multisession: Allows adding files over time, rather than during a single session. For a disk to be readable, the session must be "closed." However, this prevents adding more files to the disk. Multisession links the individual sessions and update the disk's table of contents so that it appears as a single directory.
- CD-UDF (Universal Disk Format): Industry-standard incremental packet-writing filesystem
A brief word on UDF: UDF means being able to drop files directly onto the disk. Currently, this is done at the software level. Reading the disk requires the software used to create it. UDF is in the works to be added to the Linux kernel, probably 2.6. CD drives need CD-MRW circuitry ("CD Mount Rainier ReWrite"; don't ask me how they choose these names) for this to work, so it will be a feature of new drives. When this is implemented, copying files to CD-R/RW will be as easy as copying to a floppy disk, and the disks will be universally readable. This is touted as yet another replacement for the venerable 3.5" diskette. We'll see. (See Resources for a link to more information on Mount Rainier.)
Linux SCSI emulation adventures
Use either an IDE/ATAPI or SCSI CD writer if you can. Parallel port interface is a horrid kluge asking for trouble, and USB drives are slow. Neither is well-supported in Linux (although you might have better luck with the newer USB 2.0 drives).IDE/ATAPI drives, which are the most common, need a bit of tweaking to work. So, what happens if
cdrecordshows no drives configured? To check, type this:
$ cdrecord -scanbusIf it displays your CD-RW drive (see Burning the disk, below), you can skip most of this section, although you might want to skim through anyway for your own information.
Linux uses a SCSI emulation subsystem, so IDE/ATAPI CD-writers need compatibility drivers. If there is a CD-ROM and a CD-R/RW on the same PC, both need to use the ide-scsi pseudo device driver to enable copying disks. There is no downside to using the SCSI emulation on a CD-ROM; it will work just the same; only the name will change. Depending on your particular flavor of Linux, the drive designation will change from something like /dev/cdrom0, or /dev/hdc, to /dev/scd0 (see Table 1 for a list of IDE/ATAPI device names).
Table 1. IDE/ATAPI device names
Name Device hda IDE bus/connector 0 master device hdb IDE bus/connector 0 slave device hdc IDE bus/connector 1 master device hdd IDE bus/connector 1 slave device To find drives on your system, type:
$ dmesg | grep '^hd.:'
hda: IBM-DTLA-305020, ATA DISK drive
hdb: TOSHIBA DVD-ROM SD-M1202, ATAPI CD/DVD-ROM drive
hdc: LITE-ON LTR-24102B, ATAPI CD/DVD-ROM drive
hda: 40188960 sectors (20577 MB) w/380KiB Cache, CHS=2501/255/63, UDMA(66)Most modern Linuxes come with the SCSI emulation already compiled into the kernel:
$ locate ide-scsi.o
/lib/modules/2.4.19/kernel/drivers/scsi/ide-scsi.oIf your system does not have this, you'll have to compile it into your kernel. That is way too big a subject for this wee article, so please see Resources (it's not hard, when you know how).
You'll need to edit two text files to configure the system to use the ide-scsi driver. The first is /etc/modules.conf (in Debian, /etc/modules). My system has a CD-ROM and CD-R/RW drive, hdb and hdc. Add these lines to /etc/modules.conf (or /etc/modules) using values appropriate for your system:
ide-cd ignore=\"hdb hdc\"
ide-scsiBy default, the IDE subsystem claims all ATA devices for its own, so the
ignoreline enables the SCSI subsystem to grab both the CD-R/RW and CD-ROM.Next, edit the configuration file for your bootloader, GRUB or LILO. For LILO users, add the following to the end of lilo.conf:
append="hdb=ide-scsi"
append="hdc=ide-scsi"For GRUB users, add the following to /etc/grub.conf (or in Debian, /boot/grub/menu.lst) at the end of the
kernelline:
hdb=scsi hdc=scsiNow reboot and verify that it has loaded:
$ lsmodThis will return a long list; look for ide-scsi.
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 withmkisofs, then burning to disk withcdrecord. Use the following to create the .iso file:
$ mkisofs -o test.iso -Jrv -V test_disk /home/carla/In this example:
-onames the new .iso image file (test.iso)-Juses Joliet naming records, for Windows compatibility-ruses Rock Ridge naming conventions for UNIX/Linux compatibility, and makes all files publicly readable-vsets verbose mode, for a running commentary as the image is created-Vprovides 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; I like to create a test directory:
$ mkdir /test_iso
$ mount -t iso9660 -o ro,loop=/dev/loop0 test.iso /test_isoLook 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) *
The first three numbers for each item refer to SCSI bus, device ID, and LUN (Logical Unit Number), respectively. (The fourth number is the device ID again.)
cdrecordwants these three numbers. In this example, the CD recorder is 0,1,0. Anything on SCSI bus 0 can be shortened to 1,0, leaving off the first 0. This is a common convention. Additional buses, if any, must be specified -- no shortcuts.Now write to disk:
$ cdrecord -v -eject speed=8 dev=0,1,0 test.isoIn this example:
-vis verbose-ejectejects the disk when finished-speedspecifies write speed (8)-devis the device number (0,1,0) obtained fromcdrecord -scanbus- Last is the name of the image being burned (test.iso)
This is a simple, serviceable way to create disks for public distribution, as it creates a disk that can be read on any Windows or Linux system.
mkisofsalone is good for creating .isos for download, andmkisofsis capable of creating filesystems for many platforms. Please seemkisofsman pages for more information.On a fast machine with lots of memory, you can get away with doing low-CPU-intensive tasks during recording, but it is better to do nothing else during a burn. The laser is not capable of stopping and then picking up where it left off, so any interruptions are fatal.
cdrecordwill try to run the recorder at its highest speed, so it is not necessary to specify a speed, but let experience be your guide. Specifying slower speeds is useful for correcting errors and buffer underruns. Newer drives with "burn-proof" technology (the opposite of what it's supposed to do; again, who comes up with these names?) are not plagued by buffer underruns as older drives are.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/scd0This 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.isoNotice a couple of new options,
fs=8mand-dummy.fs=8mdefines the size of the ring buffer: the bigger the better, up to a point. Remember, interruptions are fatal;fs=8mcreates 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.
-dummyis 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
CDs are built with sessions, and sessions are divided into tracks. On a single-session disk, there is a lead-in, a single TOC (table of contents), the data, and a lead-out, which finalizes the disk and prevents further recording on the disk.mkisofslinks the separate sessions together. Creating multisession disks may be easier with GUI programs like X-CD-Roast or KonCD, but here's how command-line commandos do it.The first time you record a session on a disk, use the
-multiswitch incdrecord:
$ cdrecord -v -eject speed=8 dev=0,1,0 -multi test.isoThe disk will be fixated in a manner that makes it readable and open for adding more data. To add more sessions to this disk,
mkisofsneeds to know the starting and ending sector numbers, which you can find like this:
$ cdrecord dev=0,1,0 -msinfo
0,27139Be sure to have the disk you are adding data to in the CD recorder. Then add two new switches,
-Cand-M:
$ mkisofs -o test2.iso -Jr -V Session2 -C 0,27139 -M 0,1,0 /files/path/Or better, let the command shell do the work:
$ mkisofs -o test2.iso -Jr -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
-multioption.Conclusion
CD writing in Linux is powerful and versatile. CD recorders can be shared over networks and used in automated backups;mkisofsandcdrecordalso work with DVDs. Although there are many good graphical front ends, complete functionality is at the command line.
- Check out the CDRecord home page for information on downloads, bug reporting, FAQs, and everything else related to
cdrecord.
- Find more information on Mount Rainier at mt-rainier.org.
- The Linux Kernel HowTo is a guide to compiling, upgrading, and troubleshooting Linux on x86.
- The "Super quick guide to compiling a kernel" offers a good refresher if compiling the Linux kernel is something you need to do.
- Andy McFadden's CD-Recordable FAQ answers countless CD-R questions, both general and specific.
- For a specialized and highly useful Linux distribution on a single, bootable CD-ROM, read about Knoppix in "Knoppix gives bootable, one-disk Linux" (developerWorks, February 2003).
- If you're just getting started with Linux, "Basic tasks for new Linux developers" (developerWorks, January 2003) shows how to log in/out, mount/unmount CDs, and open shell windows, among other tasks.
- For a complete listing of CD-ROM and CD-RW drives for IBM personal computing systems, go to the Storage Accessories and Upgrades page.
- Find more resources for Linux developers in the developerWorks Linux zone.
About the author
Carla Schroder is a freelance PC tamer, administering Linux and Windows systems for small businesses and writing how-tos for real people. Carla discovered computers and high-tech around 1994, and is living proof that self-taught middle-aged persons make fine computer gurus. You can reach her at dworks@bratgrrl.com.
Not all CD-ROMs burn cooperatively. I've especially run into problems lately trying to burn a distribution beta onto CD-ROM, and there's a few interesting issues that came up while trying to solve the problem:
- Large CD-ROM images can be fussier than we think. If you're consistently having trouble with disks burned at your burner's faster speed, drop the speed down quite low, say to only 4X.
- If your CD burning software has a verification feature, this may not be enough to check a subtle problem with a burn! Some Linux distributions are starting to answer this need. For example, Red Hat Linux provides a function in its installation routine called "mediacheck," as of version 7.3.
- If you're having consistent problems getting CD-ROMs burned and can't stand to deal with the slow speed fix, consider getting a CD-ROM drive that contains BURN-Proof (tm) technology. The BURN stands for Buffer UnderRuN, which is a term that refers to how we make nice shiny coasters when the buffer containing the next bit of data to burn to the CD-ROM is empty or the machine is too busy to send the data, and the CD writer just merrily goes along and writes junk to the media. BURN-Proof burners have a massive buffer and have the ability to stop and wait for more data. There are a number of products and sites that support and contain up to date information about what's happening in this product area, a quick Google search on "burnproof" is pretty educational.
The latest versions of cdrecord support BURN-Proof.
Dee-Ann LeBlanc has written over 10 computer books, over fifty articles, taught classes, and more, mostly involving the Linux operating system and its programs. Her latest book is Linux Routing from New Riders. You can reach her at dee@renaissoft.com, or find out more at http://www.Dee-AnnLeBlanc.com/.
About: Magma is a bash script designed to make CD burning at the console easier. It supports burning normal data CDs, audio CDs, blanking CD-RWs, multisession, and more.
Changes: Some more functions and some documentation updates.
(Oct 11, 2000, 06:31 UTC) (2424 reads) (4 talkbacks) (Posted by marty)
"CD-Writer are very common these days and can be seen on most desktops. Linux, as with most things, doesn't make things very easy for you. I've suffered through it so you don't."
"If you don't want to support an obsolete drive, or an older kernel, or VAX VMS, then you probably don't need to recompile the kernel or make any devices. This short document should be sufficient to get you started burning disks. Once you are started, the official documents will guide you to such esoterica as audio, bootable, multisession and hybrid disks."
"Burning cd-roms under linux is just as easy as it is under Windows, probably easier."
(Aug 13, 2000, 14:04 UTC) (461 reads) (2 talkbacks) (Posted by mhall)
"Most of us know about cdrecord and mkisofs and front-ends to those two tools. These tools are very powerful and can do alot of things but one thing they aren't able to do is record an exact copy of a compact disc."Recommended Links
Gnome's integrated Nautilus makes CD burning simple. I recently stumbled on this powerful feature, for years now I have been using the command line tool cdrecord. It is a great program, but not trivial to use. In fact, I think Nautilus uses cdrecord to do the burning, it just provides a simple GUI. With Nautilus, it is as simple as drag and drop. Here is how!
First, insert a blank CD in the writer. A window like this will popup:
Drag the files you want to burn into the empty window like this:
When you have selected all the files you want on the CD, click the "Write to CD" button on the nautilus menu. You will then get a simple dialog like this one:
Update the CD name to something meaningful, if you like and hit "Write files to CD". When the CD is complete, it will eject.
Here is another little tip, to create an autorun script. Create a plain text file named autorun, something like this:
#!/bin/sh dir=$(echo $0 |sed 's/autorun//') cd $dir fullpath=$(pwd) exec /usr/bin/nautilus $fullpathMake it executable like this:
[ken@twix]$ chmod 755 autorunor using nautilus, right click on the autorun script and set it executable.
Drag it into the burn window with the rest of your files. Now, when the CD is inserted a new nautilus window will open and browse the CD.
How about creating a CD from an ISO file? Simple, using Nautilus, browse to the desired ISO file and right click on it.
You will notice an option called "Write to CD..." at the bottom or the menu. Select that and burn away.
That's it, now you are an expert at CD creation with Nautilus.
lf227, Applications Writing CDs with Linux
Hardware setup:
Of course Linux must be up and running on your computer and you need a CD burner
to do the job.
If you have a SCSI CD burner chances are very good that your burner is
immediately recognized by the kernel. You only have to check whether your SCSI
hostadapter is supported by Linux (see the
hardware database for this). All SCSI CD writers will work under Linux.
For an ATAPI/IDE burner you have to configure SCSI emulation to make your burner
look like a SCSI device even though the hardware is physically connected via the
IDE bus. How to do this is e.g described in the
README.atapi file from xcdroast and we also recommend you to read the CD
Writing HOWTO at
linuxdoc.org
For USB burners see the USB-CD Writer HOWTO at
mobilix.org/linux_usb_cd.html.
As we both only have experience with SCSI burners we could only repeat what we
have read there.
Software to burn CDs:
For burning CDs you need the following programs:
All three are included in the cdrtools package you can download from
www.xcdroast.org
or
ftp.fokus.gmd/pub/unix/cdrecord/
With these tools you can already burn your CDs using the command line. But if
you want a nicer and friendlier graphical user interface you need one of the
frontends in addition. There are a lot of frontends available but in this
article we will only talk about xcdroast (http://www.xcdroast.org)
and koncd (http://www.koncd.org/). xcdroast
seems to be the frontend with the most possibilities and we like koncd because
it is really very easy to use.
Installation
In many cases xcdroast will already be installed on your computer but at least
with the RedHat distribution it is compiled with the pam-library which means it
will always ask you for the root password if you want to burn CDs and you
probably don't want to give the root password to all users who want to burn CDs.
A second drawback is that it will not allow you to start the program remote over
a network. Therefore it is better to download the latest version from http://www.xcdroast.org.
This should be straight forward as there are pre-compiled packages for most of
the common distributions available.
koncd can be downloaded from www.koncd.org. Recent versions of koncd rely on new
QT/KDE features. If you don't want to spend time updating your QT and KDE
libraries you can use an older version of koncd. For this article we have used
koncd-0.7.5 running under redhat 7.1.
To burn CDs you first of all must have write permissions to the /dev/sg* devices which are used for the communication with the hardware. But cdrecord also uses some realtime extensions to avoid buffer underruns during the writing process that require root permissions as well. The best solution is therefore to use SUID on cdrecord and cdda2wav. Uhh? SUID? Don't worry. You can read Guido's article on file permissions if you want to know exactly what it is but for the moment it is sufficient if you type in the following two commands and then forget about it again :-)
chmod 4111 /usr/bin/cdrecord
chmod 4111 /usr/bin/cdda2wav
Be aware that this could be a potential security risk but it is definitively
less of a security risk than telling everybody who wants to burn a CD what the
root password is.
Now you can test if your CD writer is recognized correctly. Just run:
cdrecord -scanbus
If everything is alright then you should see something like:
0,6,0 6) 'PLEXTOR ' 'CD-ROM PX-W8220T ' '1.03' Removable CD-ROM
The numbers and the description may be different dependent on your hardware
setup.
Alternatively you can also click on the SETUP button of xcdroast or koncd and
check there if your burner is recognized correctly.
So let's now finally start burning a CD.
There are four necessary steps to write CDs:
CDs generally need to be written in "one go" and the data flow needn't be
disturbed during the writing process. Thanks to the realtime extensions buffer
underruns who lead to faulty CDs are only a problem of windows users. With Linux
you don't really need "burn proof". There is a special buffer called FIFO inside
the CD writer to compensate for small disturbances which is usally enough to
avoid burn failures under Linux. Nevertheless you should be cautious and don't
do things that need too much CPU power. You can browse the web, compile
software, ... but deleting a large file can be a problem and maybe is enough to
disturb the process which then results in a faulty CD.
If you are concerned about buffer underruns you can use the simulation write
(dummy write) option to first test if the CD writing would work before actually
burning it. There the burning process is tested with real data but the laser
inside the CD writer is turned off. It is always better to run a test first than
to have to do it all over again.
The fact that you usually have to burn in "one go" which means that if you have
forgotten something, even if it is only a single small file you have to burn the
CD again. There is the possibility of multisession where you can add something
later but we won't talk about it here because with multisession you can't read
the CD on many CD writers as long as it is not ready and as the prize of one CD
is so low we never had a reason to use it.
When you start koncd or xcdroast you will recognize that both of them have a
setup button. Here you can find out if your burner is recognized correctly and
set general options.
Let's look at the setup of xcdroast and koncd:
Here you should think about the format a little bit first. If the song is
from another CD there is no problem. You can just go on and copy it. But
otherwise you should notice that cdrecord recognizes au and wav files and
converts them automatically to the right format to play it on your CD player but
for other formats you need to convert them to wav first if you later don't want
to hear only noise on your CD. To convert a file from mp3 to wav you can do the
following on the command line:
mpg123 -w /tmp/song.wav song.mp3
This allows you to make normal audio CDs from mp3 music. It takes more space but
can be played in almost every CD player.
When finally burning the CD you can choose whether you want the copy to be in
TAO or DAO mode. In TAO mode you will have 2 seconds of a pause between each
song while you don't have that in DAO mode which makes it the mode of choice for
live music recordings. TAO= Track at Once and DAO= Disk at Once.
You can copy a CD completely or mix songs from different CDs, or other sound
files e.g. downloaded from the internet.
Let's first see how you can copy a CD without changes:
Let's now look what you have to do if you want to burn a CD with music from
various places:
Let's look at the menu:
For data CDs you need a filesystem or as is often said the CD must be
formatted. You have to choose which filesystem you want. This choice will depend
on which operating system(s) you want to be able to read the data. The ISO-9660
standard which describes the CD filesystem for example does not allow long file
names. Therefore extensions have been made for this standard. For Linux and Unix
RockRidge extensions are used, Microsoft uses Joliet extensions.With the
RockRidge format you can also have permissions etc. as you already know it from
your system.
The recommended solution is to use RockRidge and Joliet extensions on the same
CD.
If you just want to copy a CD from another existing CD you don't have to worry
about that because then the CD already has a filesystem and this is copied as
well.
If you want to copy data from your hard disk :
Now go to "Write Tracks":
Here you use the image that you created under the panel "Master tracks". Go
to the panel "Layout tracks", select your image and press "add". Then go back
to the panel "Write tracks" and press the button "write tracks" at the
bottom. Now your CD is burned.
Basically you can backup everything on CD with the method described under
"pure data CDs". If the data in your home directory is too big to fit onto one
CD then you need to select individual sub-directories and write them to a
different CD.
It can be useful to check if the ISO image is correct before finally burning it. To do this you can mount the ISO image as if it was a real CD:
Change to root: su -
Create an empty directory (known as mount point): mkdir /tmp/mycd
Mount the ISO image (connect the ISO image to the directory):
mount -o loop -t iso9660 Image.iso /tmp/mycd
Now you can use the command "ls" to inspect the CD image: ls /tmp/mycd
If it looks ok then unmount it: umount /tmp/mycd
... and burn the image to your CD.
Above we have discussed two graphical frontends to burn CDs but you can also
burn CDs using only the command line. If you look at the man page of cdrecord
you will see that there are hundreds of options, uuuhh... don't be scared. It's
much easier than it looks at first. Download the two perl scripts cdrecordeasy
and mkisofseasy.
They are included in the package
easycdscripts
(download page)
Unpack them with the command
tar zxvf easycdscripts-0.1.tar.gz
Now run the command cdrecord -scanbus. Look at the line where you see your CD
burner and remember the numbers that you see at the beginning. It should be
something like 0,4,0 or 0,6,0 ....
Edit the file cdrecordeasy by entering this number behind the line that says
$dev=... You will find it somewhere at the beginning.
Now the installation of our two little scripts is finished. Creating a data CD
is now very easy:
That's it. Much easier than it looked at the beginning, isn't it!? :-)
Have fun with your CDs!
Copyright © 1996-2007 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Standard disclaimer: The statements, views and opinions presented on this web page are those of the author and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.
Last modified: February 28, 2008