Creating CDs
Remember when creating CDs, the root of the CD is relative to the created directory; in this case, cdimage. Once you have your files in this directory, you are ready to create the iso9660 image using the mkisofs command. To create the basic image, use the following command:
mkisofs -r -o cdimage.iso cdimage
The -r option ensures the image contains additional file description data by way of the Rock Ridge protocol, preserving the original file name and setting permissions optimally for CD-ROMs such that read/execute permissions become global, write permissions are cleared, and special mode bits are also cleared since they do not apply on CD-ROMs. The -o option designates the output file (cdimage.iso). The last value is the directory in which the files are located.
Many commercially manufactured Linux CDs, such as Red Hat, are bootable. This isn't difficult to do using the “El Torito” standard. Most newer BIOSes today support the bootable CD feature, and most bootable CDs for the PC are based on El Torito. El Torito makes your CD appear as a floppy, and thus your BIOS can boot it.
If you want a bootable CD, you'll need a 1.44MB boot image intended for a boot floppy. In our distribution example, we could use the boot image used for installation. For distribution_b, the name of the boot image is boot.img. The process by which we make a CD bootable takes place in the creation of the iso9660 image (International Organization for Standardization specification for compact disk read-only memory). Thus, before we create our image, we need to create a directory inside of cdimage to hold the boot image; a directory called boot would work fine. So, we place the image boot.img into cdimage/boot and create the iso9660 image by executing the following command:
mkisofs -r -b boot/boot.img -c boot/boot.cat -o\ cdimage.iso cdimage
Here we have two new options, both of which are used to make the CD bootable. The -b option is followed by the name of the boot image to be booted. Note that the file is relative to the root of the CD. The -c option is followed by the name of the boot catalog required by El Torito; this file is automatically created by mkisofs. Only the more recent versions of mkisofs allow for the automatic creation of the boot catalog; older versions require you to create it yourself.
Before actually burning the CD, take a look at your image layout by mounting it. This is done using a loopback device, so this must be supported in the kernel. The following command will mount your image:
mount -r -t iso9660 -o loop cdimage.iso /mnt
Once you've created your image, bootable or not, you are ready for the final process of burning it onto the CD using either cdrecord or cdwrite. Take the following into consideration before you start:
Make sure the computer isn't experiencing any excessive vibrations.
Make sure the image is on a local hard drive.
Make sure the load on your system isn't too high.
Keeping these three things in mind will help prevent errors during the write process. The CD writer can be put through a test process that won't actually write, but will simulate the entire process. This is done by adding the -dummy option for cdrecord and the -y option for cdwrite. Now all that is left is inserting a blank CD and executing the command that matches your choice of writer.
cdrecord -eject -v -isosize speed=2 dev=0,0\ cdimage.iso cdwrite -ev --device /dev/??? -s 2 cdimage.isoThe first two options for both utilities are eject and verbose. Thus, the CD will eject after the burning process is finished, and the program will run in verbose mode. The option -isosize for cdrecord limits the size of the CD to the size of the iso9660 image. The options speed=2 and -s 2 indicate the speed at which to write to the CD; in this case, the 2 means at 2x. Finally, the options --device, dev=0,0 and /dev/??? set the target device, where /dev/??? should be your CD-R (i.e., /dev/scd0) and 0,0 stands for the SCSI ID and bus in that order.
If all worked out well, congratulations. You now have a full-fledged, iso9660 CD. You can make a CD with other formats just as well. The utility mkhybrid, included with mkisofs, can make images of Joliet and HFS format. It is also possible to make a CD with the EXT2 file system format. Have fun burning!
Alex Withers has been using Linux since 1.1.59. He is currently studying computer science at Gonzaga University and can be reached at awithers@gonzaga.edu.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- What's the tweeting protocol?
- New Products
- RSS Feeds
- Readers' Choice Awards
- Trying to Tame the Tablet
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.




13 hours 43 min ago
16 hours 15 min ago
17 hours 32 min ago
18 hours 7 min ago
18 hours 30 min ago
23 hours 18 min ago
1 day 5 min ago
1 day 1 hour ago
1 day 3 hours ago
1 day 5 hours ago