CD−Writing HOWTO
CD−Writing HOWTO Table of Contents CD−Writing HOWTO........................................................................................................................................1 Winfried Trümper ..................................................................................................1 1.Introduction...........................................................................................................................................1 2.
CD−Writing HOWTO Table of Contents 4.13 Is it possible to use several writers at once?..................................................................................26 4.14 What about Solaris, *BSD, AIX, HP−UX, etc.? Is my variant of Unix supported?.....................26 4.15 Where to store the local configuration permanently?....................................................................27 4.16 How can the CD−info be retrieved?.....................................................................
CD−Writing HOWTO Winfried Trümper v2.9.3, 23 July 2000 This document explains how to write CD−ROMs under Linux. 1.Introduction • 1.1 Copyright, license and terms of usage • 1.2 Availability • 1.3 Suggested readings • 1.4 Terminology ... lasers at maximum ... fire! • 1.5 Supported CD−writers • 1.6 Supported "features" • 1.7 Mailing Lists 2.Setup the Linux−system for writing CD−ROMs • 2.1 Quickstart • 2.2 Get the user software for burning CD−Rs 3.Burning CD−Rs • 3.
CD−Writing HOWTO • 4.7 Is it possible to make a 1:1 copy of a data CD? • 4.8 Can Linux read Joliet CD−ROMs? (obsolete answer) • 4.9 How do I read/mount CD−ROMs with the CD−writer? • 4.10 How to put even more data on the CD−R? • 4.11 How to make bootable CD−ROMs? • 4.12 How to make CD−ROMs writable like a hard disk? • 4.13 Is it possible to use several writers at once? • 4.14 What about Solaris, *BSD, AIX, HP−UX, etc.? Is my variant of Unix supported? • 4.
CD−Writing HOWTO applications kindly submitted by the readers. 1.1 Copyright, license and terms of usage Copyright Winfried Trümper 1996−2000. All rights reserved. Redistribution and use, with or without modification, are permitted provided that the name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. In this sense, translations are welcome and need not to be authorized by me.
CD−Writing HOWTO software. As most CD−writers can be used to read CD−ROMs, too, you may want to read the Linux CD−ROM HOWTO, the Linux SCSI HOWTO and the Linux Kernel HOWTO. 1.4 Terminology ... lasers at maximum ... fire! CD−ROM stands for Compact Disc Read Only Memory, a storage medium utilizing an optical laser to sense microscopic pits on a colorful shimmering disk. The pits represent the bits of the information and are so petite that some billions of them fit on the disc.
CD−Writing HOWTO out of the HOWTO.
CD−Writing HOWTO Traxdata: Turtle Beach: Waitec: WPI (Wearnes): Yamaha: CDR−56S−400, CD−R56S−600, R56S−614 CRW 2260, CDR 4120, CDR 4120 Pro, CDRW 4260, CDRW 4424, CDR 4800 2040R wt 2036, wt 2444ei CDRW−622, CDR−632P CDR−100, CDR 102, CDR−200, CDR−200t, CDR−200tx CDR−400, CDR−400c, CDR−400t, CDR−400tx, CDR−400Atx CDW−2216E, CRW−2260, CRW−2260t, CRW−4250tx, CRW−4260t, CRW−4260tx, CRW−4261, CRW−4416S, CRW−6416S, CRW−8424E Table: CD−writers supported under Linux The detailed list of models which have been r
CD−Writing HOWTO Feature mkisofs mkhybrid mkvcdfs −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ISO 9660 yes yes no RockRidge yes yes no El Torito yes yes no HFS no yes no Joliet yes yes no Multisession yes yes no CD−Extra yes yes no Video−CD no no yes Table: The most obvious difference between the ISO 9660 filesystem compared to the ReiserFS or Extended−2 filesystem is: you can't modify files once they are written.
CD−Writing HOWTO 2.Setup the Linux−system for writing CD−ROMs This section applies to the following types of CD−writers: SCSI, IDE/ATAPI and the devices for the parallel port. USB CD−writers are not supported as of May 2000. Non−SCSI writers require compatibility drivers, which make them appear as if they were real SCSI devices.
CD−Writing HOWTO 2.1 Quickstart This section is an attempt to provide an fast and easy description of the configuration. Not all possible setups are covered, but please go on and try it out anyways. First of all, check the Linux kernel version printed by the command "uname −r". It should be something like 2.0.X or 2.2.Y, where X is higher than 36 and Y is higher than 11. If you run older versions or the so called development kernels, you are on your own.
CD−Writing HOWTO fi if ! grep "^........ sg_" /proc/ksyms > /dev/null; then report_no_autoload sg && insmod sg fi if ! grep "^........ sr_" /proc/ksyms > /dev/null; then report_no_autoload sr_mod && insmod sr_mod fi if ! grep "^........ loop_" /proc/ksyms > /dev/null; then report_no_autoload loop && insmod loop fi if ! grep iso9660 /proc/filesystems > /dev/null; then report_no_autoload iso9660 && insmod iso9660 fi echo "The following is only needed for IDE/ATAPI CD−writers.
CD−Writing HOWTO The table above shows the relation of device file names and the placing of devices on the IDE busses. The device file name representing your CD−Writer has to be passed to the driver in the Linux kernel. Example: hdb=ide−scsi. Such a setting should be added to lilo.conf or chos.conf if the driver is statically compiled into your kernel, which seems to be the most common setup.
CD−Writing HOWTO Special notes about SCSI CD−writers Please make sure that your writer is recognized by the BIOS of your SCSI hostadaptor card. Every SCSI hostadaptor scans the SCSI bus after power on and reports all devices found connected to the bus. The report includes the SCSI ID of the devices and their product label. It makes no sense to proceed unless your CD writer is listed in that report.
CD−Writing HOWTO PARIDE Parallel port ATAPI CD−ROMs PARIDE Parallel port generic ATAPI PARIDE (select a low−level driver) M M Y SCSI SCSI SCSI SCSI SCSI SCSI support scsi_mod SCSI CD−ROM support sr_mod Enable vendor−specific SCSI generic support sg (select a low−level driver) Y/M Y/M Y Y/M Y Y/M Y/M Y Y/M FS FS ISO 9660 CDROM filesystem Microsoft Joliet cdrom...
CD−Writing HOWTO ftp://ftp.ge.ucl.ac.uk/pub/mkhfs (mkhybrid) To write images to the CD−R, you need one of the following software packages: ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ (cdrecord) http://www.ping.de/sites/daneb/cdrdao.html (cdrdao) http://www.munich−vision.de/vcd/ (mkvcdfs) Don't trust the man page of old versions of mkisofs which state you need version 1.5 of cdwrite. Just use cdrecord and you are fine.
CD−Writing HOWTO 3.Burning CD−Rs "If to smoke you turn I shall not cease to fiddle while you burn." (Roman emperor Nero about burning his own classic−CDs, AD64. He misunderstood it completely and burned Rome down.) Writing CD−ROMs consists of two steps under Linux: • packaging the desired data (files, music or both) into files with special formats • writing the data from the files to the CD−R with the utility cdrecord This chapter describes the steps for data and audio CDs in greater detail. 3.
CD−Writing HOWTO write output to take directory as input The option '−r' sets the permissions of all files to be public readable on the CD and enables RockRidge−extensions. You probably want to use this option unless you really know what you're doing (hint: without '−r' the mount point gets the permissions of private_collection!). mkisofs will try to map all filenames to the 8.3 format used by DOS to ensure the highest possible compatibility. In case of naming conflicts (different files have the same 8.
CD−Writing HOWTO /cdrom may not be fully readable. Please use a more recent kernel like 2.0.36. The option −pad for cdrecord applies to audio CDs only and the option −pad for mkisofs requires a patch, which is as much work to apply than to upgrade to a bug−free Linux kernel.) Note: Some ancient versions of mount are not able to deal with loopback devices. If you have such an old version of mount, then upgrade your Linux−system.
CD−Writing HOWTO shell> shell> shell> shell> SCSI_BUS=0 # taken from listing 1 "scsibus0:" SCSI_ID=6 # taken from listing 1 "TOSHIBA XM−3401" SCSI_LUN=0 cdrecord −v speed=2 dev=$SCSI_BUS,$SCSI_ID,$SCSI_LUN \ −data cd_image # same as above, but shorter: shell> cdrecord −v speed=2 dev=0,6,0 −data cd_image For better readability, the coordinates of the writer are stored in three environment variables with natural names: SCSI_BUS, SCSI_ID, SCSI_LUN.
CD−Writing HOWTO shell> sox killing−my−software.wav killing−my−software.cdr This command would convert the song killing−my−software from the WAV−format into the CDR audio−format. See the man page for sox for more details about formats and filename−extensions sox recognizes. Because the output of the manual conversion takes up much disk space, it was made a built−in feature of cdrecord for the sound formats WAV and AU. So as long as your sound files have the extensions .wav or .
CD−Writing HOWTO off). DAO If you want to get rid of the pauses between the audio tracks, you have to use disk−at−once (DAO) recording versus the (individual) track−at−once (TAO) recording described above. Support for DAO is currently most advanced in cdrdao. Please see its homepage for details. If you master the CD in DAO mode, then you use a monolithic image (sound file) and control track information with a configuration file. CD_DA TRACK AUDIO FILE "live.wav" 0 5:0:0 INDEX 3:0:0 TRACK AUDIO FILE "live.
CD−Writing HOWTO 4.1 How sensitive is the burning process? Test it. Use the option −dummy to do an empty run of cdrecord. Do everything you would do otherwise and watch if the burning process survives. If you feed cdrecord directly from mkisofs, then disk intensive processes such as updating the locate database lower the maximum flow rate and may corrupt the CD. You better check such processes are not started via cron, at or anacron while you burn CD−Rs on older machines. 4.
CD−Writing HOWTO 4.4 Isn't there some way to get around the ISO−9660 limitations? Yes. You can put any filesystem you like on the CD. But other operating systems than Linux won't be able to deal with this CD. Here goes the recipe: • Create an empty file of 650MB size. dd if=/dev/zero of="empty_file" bs=1024k count=650 • Create an extended−2 filesystem on this file shell> /sbin/mke2fs −b 2048 empty_file empty_file is not a block special device.
CD−Writing HOWTO Or you want to try the combination of "cdda2wav" and "sox", available from sunsite and its mirrors: ftp://sunsite.unc.edu/pub/Linux/apps/sound/cdrom/cdda2wav0.71.src.tar.gz ftp://sunsite.unc.edu/pub/Linux/apps/sound/convert/sox−11gamma−cb3.tar.gz cdda2wav enables you to get a specific interval (or a whole track) from your audio CD and converts it into a .wav−file. sox converts the WAV files back into the (audio CD) cdda−format so it can be written to the CD−R using cdrecord.
CD−Writing HOWTO First case: you have a CD−writer and a separate CD−ROM drive. By issuing the command cdrecord −v dev=0,6,0 speed=2 −isosize /dev/scd0 you read the data stream from the CD−ROM drive attached as /dev/scd0 and write it directly to the CD−writer. Second case: you don't have a separate CD−ROM drive.
CD−Writing HOWTO 4.10 How to put even more data on the CD−R? Use bzip2 instead of any other compressor like gzip or pkzip. It will save you up to 30% of disk−space for larger (>100kb) files. You can download it from http://www.muraroa.demon.co.uk/ Instead of writing a true audio CD, you can optionally convert your WAV audio files into MP3 audio files and store them on a ISO−9660 filesystem as regular files. Usually MPEG III give you a compression of 1:10.
CD−Writing HOWTO Place this floppy image into the directory holding the collection of your files (or into a subdirectory of it, just as you like). Tell mkisofs about this file with the option '−b' and also use '−c'. For details read the file README.eltorito in the mkisofs−distribution. An interesting application for a custom bootable CD is as a virus safe DOS− or Windows−system. It saves you the money for the hard disks (if you have a network and use samba to put the user−data on a file server).
CD−Writing HOWTO 4.15 Where to store the local configuration permanently? You have two options. Either you use the built−in configuration file for cdrecord, or you use a shell wrapper like the one shown below. This shell script reads a configuration file, which lists the options and parameters for cdrecord line by line. The names are exactly the same as on the command line, but without the leading dash. Comments are allowed.
CD−Writing HOWTO then O_CDRECORD="$O_CDRECORD −$O_NAME " continue fi O_CDRECORD="$O_CDRECORD $O_NAME=$O_VALUE " done < "$CFGDIR/$CFG" set −x #DEBUG exec cdrecord $O_CDRECORD $ARGS_LEFT echo "Execution of cdrecord failed." 4.16 How can the CD−info be retrieved? Somewhere behind the first 32 k on the CD, a block with information about the CD is located.
CD−Writing HOWTO specify the switch −data for cdrecord on the command line. The images for the second and subsequent sessions are a little bit more complicated to generate. Mkisofs must know where the free space on the CD−R begins. That information can be gathered by using the option −msinfo on cdrecord (see example below).
CD−Writing HOWTO Your ftp−client will notice when cdrecord wants to read from the file and will start transfering data from the ftp−host. 4.21 I hear a crack or click sound at the end of the each track. You have to use disk−at−once mode (DAO) to get rid of the cracks. 4.22 How can this be set up so that a user can burn CDs instead of always being root? You can add the setuid−bit to the cdrecord−executable. However, this might be a security risk.
CD−Writing HOWTO level applications like the ones mentioned above. 4.25 Which is easier to set up, IDE or SCSI? SCSI CD−writers are slightly easier to set up with regard to CD−writing under Linux. And they are reported to have better error recovery. If that outweights the higher price cannot be answered generally. 4.26 How can I overburn a CD using {cdrecord,cdrdao}? Overburning a CD−R is nothing special. It is at your own risk that the data fits on the CD−ROM, but thats all.
CD−Writing HOWTO 4.30 Which format to choose for a platform independant CD−ROM? A CD−ROM to be read by all systems can only use the plain ISO 9660 format. That means stupid 8+3 filenames from old MS−DOS and without any HFS (Macintosh), Joliet (Microsoft) or RockRidge (newer Unices) extensions. There is no extension for longer filenames, which could be read by all operating systems. 4.
CD−Writing HOWTO 5.1 It doesn't work: under Linux Please check first, that the writer works under the software it is shipped with (=under another operating system). Concretely: • Does the controller recognize the writer as a SCSI device? • Does the driver software recognize the writer? • Is it possible to make a CD using the accompanied software? If "it doesn't even work" with the accompanied software you have a hardware conflict or defective hardware.
CD−Writing HOWTO Under various circumstances SCSI devices dis− and reconnect themselves (electronically) from the SCSI bus. If this feature is not available (check controller and kernel parameters) some writers run into trouble during burning or fixating the CD−R.
CD−Writing HOWTO cd /dev ls −l scanner # shows current setting ln −sf sg2 scanner # test the scanner ln −sf sg1 scanner # test the scanner # and so on Application developers should carefully think about support for this dangerous and error prone naming scheme. Please consider at least to use intermediate solutions like the SCSI coordinates used by cdrecord. 6.Credits Many thanks go to the readers of this HOWTO, who contributed actively to its contents.
CD−Writing HOWTO fixed adapter spelling problems Jos van Geffen noted the problem in 4.9. Bernhard Gubanka noticed the need of a recent version of mount to utilize the loopback device Stephen Harris contributed hint about writing audio CDs Janne Himanka pointer to kernel patch to read Joliet CD−ROMs Stephan Noy information and experience about writing audio CDs Don H. Olive
CD−Writing HOWTO Gerald C Snyder tested writing of an ext2 CD−ROM (see 4.4) Art Stone had the idea to put non−ISO−9660 filesystems on a CD The Sheepy One suggested using defective CD−ROMs as coasters for drinks Erwin Zoer Futhermore, I would like to thank the following people for reporting spelling mistakes: Bartosz Maruszewski , Alessandro Rubini , Ian Stirling , Brian H.