/***************************************************************/ /* Short note on how to make a bootable DVD in Unix. */ /* */ /* Version: 0.1 */ /* Date : 9/12/2010 */ /* By : Albert van der Sel */ /***************************************************************/ In this note, we will touch the subject on how to make a bootable CD or DVD. But... one thing first though: this note does not contain "clear cut" instructions. You may view it as a set of pointers, or maybe even an intro, on the subject, and thus it could be of use for people who are not familiar at all with the subject. 1. First, a few notes about "CD" and "DVD" disks: ================================================== 1.1 DVD: -------- DVD is short for Digital Video Disc (or Digital Versatile Disc). It's an optical disc storage media format, and you can store various types of data on them (like "video" or just "data"). DVDs are of the same dimensions as compact discs (CDs), but are capable of storing much more data. The 12 cm type is a standard DVD, and the 8 cm variety is known as a MiniDVD. These are the same sizes as a standard CD and a mini-CD, respectively. There are certain types of DVD's, which relate to the way data is stored on the discs: - DVD-ROM (read only memory) has data that can only be read and not written; - DVD-R and DVD+R (recordable) can record data only once, and then just functions as a DVD-ROM; - DVD-RW (re-writable), DVD+RW, and DVD-RAM can all record and erase data multiple times. Certainly not all types are interchangable, or "compatible". If you take into account the different types of drives as well, the compatibility really can be a pain sometimes. In general terms, the DVD-RAM is the least compatible of all Read/Write DVD types. Due to several implementations of Single side or Dual Side and/or multiple layering, capacities varies between 3.95 GB to 9.40 GB. But some very specific versions will go beyond that maximum. What we might call a "common DVD", has a capacity of 4.7GB. 1.2 CD: ------- An "older" type of optical disk is the CD or CDROM. The original CD just is read-only media, but later on, a write-once version emerged, as well a re-writeable version, called a CD-R/RW . As technology developed, for re-writable optical disks, people ofcourse turned their attention to "DVD-RW/RAM". The capacity of a plain old CDROM is about 650MB, or 700MB, while a standard DVD is about 7x that capacity. 1.3 Bootable CD or DVD: ----------------------- A bootable CD or DVD is build up according to the El Torito standard. This means that the ISO9660 File System has an extension which provides information to a startup ROM or BIOS, so that the ROM knows where to boot from and what files to load from where. An ISO image is an archive file (or disc image) of an optical disc, composed of the data contents of every written sector of an optical disc, including the optical disc file system. ISO images can be created from optical discs, or, the other way around, can be used to recreate optical discs using specialized software. ISO image files typically have a file extension of .iso. The name ISO is taken from the ISO 9660 file system, but an ISO image might also contain another type of file system. One important feature of an ISO image is, that it can be easily burned to a CD or DVD. The "bootable info" on a bootable DVD, is part of the ISO file. Now, to make a bootable DVD, we DO NOT "just copy" the iso file to the DVD (or CD RW). Instead, you need to create a specific filesystem on the disk, using burning software or the commandline. Often you can choose for the ISO9880 file system, or the newer UDF fileystem. The best choiche just depends on your OS and how interchangable you need to be. In general, creating a bootable CD or DVD goes as follows: - You either create an suitable image, like an iso, or you obtain one (from the internet) - Then you use a specialized command, or utility, that creates the filesystem on the DVD included the special bootimage which makes it bootable. 2. Creating a bootable CD or DVD: ================================= 2.1 Typical steps on Linux: --------------------------- People often make a difference between a "live DVD" and "bootable DVD". A live DVD means that you can boot a whole OS from DVD, while bootable just means that it is bootable. It can be done with all distro's, but a few a very popular using this feature, like for example "knoppix". Especially Linux distro's, have great graphical capabilities and diskutils. You can also download many graphical DVD burning tools as well. You most likely would prefer that, above using the commandline. Anyway, using the commandline, a typical session is described below. The commandline tools "mkisofs" and "cdrecord" are your powertools in Linux. CD RW: ------ If you have an .iso that you want to burn to CD RW: - Obtain an El Torito (ISO9660) iso image file. Suppose you have found "file.iso" on the Internet and downloaded it into /tmp Optionally, if you have downloaded it from the Internet, you might have also found an md5 file, containing the checksum number. Then you can check the integrety of your download using: # md5sum file.iso And compare the output with the content of the md5 file. Note: on some systems use # sha1sum filename - Find the SCSI address of the drive using # cdrecord -scanbus - Suppose you have found that "1,0,0" identifies your drive. Next, use the "cdrecord" command: # cdrecord -v -dao dev=1,0,0 /tmp/file.iso If you don't have an .iso file: In the above case, you already had found an .iso file. So what if you want to burn a CD from as a source a directory on your machine? Here, you can use "mkisofs". Suppose you want to burn /home/albert to the CD. First, use the following to create the .iso file: $ mkisofs -o albert.iso -Jrv -V my_disk /home/albert/ In this example: -o names the new .iso image file (albert.iso) -J uses Joliet naming records, for Windows compatibility -r uses Rock Ridge naming conventions for UNIX/Linux compatibility, and makes all files publicly readable -v sets verbose mode, for a running commentary as the image is created -V provides a volume Name (my_disk); Last on the commandline are the files selected for packaging into the .iso (which is /home/albert) Ok, now you can just mount it, as a "filesystem" and browse around... # mkdir /test_iso # as usual, make a mountpoint somewhere # mount -t iso9660 -o ro,loop=/dev/loop0 albert.iso /test_iso Next, walk through the directory contents; all your files should be there and readable as usual. 2.2 AIX: -------- In AIX, the "mkisofs" command is available, as well as a few other specific commands. But two of them, the "mkcd" and "mkdvd" commands are most popular. And a nice thing is, that an (ascii) graphical interface is available, which are: # smitty mkcd and # smitty mkdvd These commands will lead to menu guided screens, and you just fill in the options that applies for your situation. One important further remark is, that it seems that AIX only supports DVD-RAM. With the mkdvd command (or smitty mkdvd), you can create bootable and non-bootable DVD's in Rock Ridge (ISO9660) or UDF (Universal Disk Format) format. A similar story holds for the mkcd (or smitty mkcd) command. How does it work? You either use a preexisting mksysb file, or else let the command call the mksysb command. A "root volume group" (rootvg) backup, actually is a backup of the whole OS (kernel, drivers, /usr, /etc, /var, etc..). It's often done as a socalled "mksysb" backup to tape. This tape will be bootable. You do not perse need to backup to tape, and you can backup to a file as well. Now, if you copy that file to DVD, that ofcourse will NOT produce a bootable DVD. And, by the way, such a mksysb file, does NOT have any sort of bootcode (bosboot image), as opposed to what a tape would have. If you have the mksysb file, you first need to create an "image" (from the file) that will be suitable to be transferred to CD RW or DVD. So, it is a sort of "multi-stage" operation. Traditionally, mkcd and mkdvd expects a "dedicated" filesystem called "/mkcd" (with subdirs) where the "mksysb" file will be operated on, and ulimately a transferable source will be created, which can be written to the DVD. Now, you either have that filesystem already in place, or you use the menu to let it be created as needed. From the commandline, the parameter "-m mksysb_image" would determine that you want to use an existing mksysb file, otherwise mkdvd will call the mksysb command. The neat thing of using smitty, is that after you have filled in the options of the menu, you can press the F6 key to see the equivalent command. The not so neat thing is that it can be a hassle to have the right disks for your specific DVD drive. Suppose you create the mksysb file as follows: # mksysb -i /backups/mksysb1 Now start smitty: # smitty mkdvd +--------------------------------------------------------------------------+ ¦ Use an existing mksysb image? ¦ ¦ ¦ ¦ Move cursor to desired item and press Enter. ¦ ¦ ¦ ¦ 1 yes ¦ ¦ 2 no ¦ ¦ ¦ ¦ F1=Help F2=Refresh F3=Cancel ¦ ¦ F8=Image F10=Exit Enter=Do ¦ ¦ /=Find n=Find Next ¦ +--------------------------------------------------------------------------+ +--------------------------------------------------------------------------+ ¦ DVD backup media format? ¦ ¦ ¦ ¦ Move cursor to desired item and press Enter. ¦ ¦ ¦ ¦ 1 ISO9660 (CD format) ¦ ¦ 2 UDF (Universal Disk Format) ¦ ¦ ¦ ¦ F1=Help F2=Refresh F3=Cancel ¦ ¦ F8=Image F10=Exit Enter=Do ¦ ¦ /=Find n=Find Next ¦ +--------------------------------------------------------------------------+ Type or select values in entry fields. Press Enter AFTER making all desired changes. DVD-RAM Device [/dev/cd0] * Location of existing mksysb image [/backup/mksys1] Advanced Customization Options: Do you want the DVD to be bootable? [yes] Install bundle file [] File with list of packages to copy to DVD [] Location of packages to copy to DVD [] Customization script [] User supplied bosinst.data file [] Debug output? no User supplied image.data file [] 2.2 Solaris: ------------ 2.4 HP-UX: ----------