Handling CD-Images
Summary:- What CD-Images Are
- Creating CD-Images
- Mounting CD-Images
- Checking CD-Images
- How to check the MD5 sum of an ISO image under Windows or GNU/Linux
- Burning CD-Images
- Burning CD-Images under Windows
What CD-Images Are
CD-Images, commonly referred to as ISO images, are byte per byte copies of CDs. Rather than distributing the content of a CD file by file, these images are exact copies of the ISO9660 file system on a CD (hence the name). This means you only need to handle one file and you don't have to worry about creating a file system on the new CD or making the CD bootable (if the original was bootable, that is). You just burn that image on a new CD and you have an exact copy of the original. As you will see, you don't even need to burn the image onto a CD to access its contents, you can do that right from within your Mandriva Linux system.iso, raw, cdr, bin, cue, ...
The filename extensions 'iso', 'raw' and 'cdr' all indicate an ISO image which can be handled by the standard 'cdrecord' command.'bin'/'cue' images, however, seem to be a different kind of animal. First of all, you need a '.cue' file and the corresponding '.bin' file. You can then either burn a CD using cdrdao from your Mandriva Linux CD, or convert this format to a standard .iso file using bchunk, which also comes with Mandriva Linux. section index - top
Creating CD-Images
Creating ISOs consists of two steps: gathering the files you want to put on the image and creating the image from those files. The first step is pretty simple: create a new directory and put your files in there. The second step is performed using the 'mkisofs' utility, which is part of the 'cdrecord' package: mkisofs -r -J -o cd_image.iso dir_with_files/ This creates cd_image with the files contained in dir_with_files. The '-r' option enables the so-called '~RockRidge' extensions. These extensions allow for longer than 8 characters file names in Linux and keep the permissions intact. You should always set this, otherwise file names and permissions will be screwed up badly.The '-J' option enables the so-called 'Joliet' extensions which do the same for Windows (well, apart from the permissions, of course). If you don't use these extensions, the longer file names made possible by ~RockRidge will be mapped to 8 character file names in Windows. The CD will still work in Windows, but for maximum compatibility, use this option. If you've got nothing to do on a rainy winter evening, have a read through the 'mkisofs' man page for the rest of the 40 available options ... section index - top
Mounting CD-Images
In order to see what's on an ISO image, you don't have to burn it to a CD. You can open them right from within Linux:- As 'root', create a new directory to mount the image to, e.g. '/mnt/iso':
- Now mount it (also as 'root'):
- You can now browse the contents of the image via /mnt/iso like you would do with any other directory.
- You unmount the image with
Checking CD-Images
See how to check the MD5 sum of an ISO image under Windows or GNU/Linux. If you've downloaded an ISO image from somewhere else, it is always a good idea to check the image for errors. In fact, you should never use an unchecked image. Errors in ISO images make the files they contain unusable.The problem with these errors is that they usually do not show up when browsing the CD, they may even only corrupt a small percentage of the files, but as soon as you try to use these files, say to install an operating system, you are bound to encounter the strangest behavior (files missing or applications crashing, system errors, system freeze etc). This checking is done by comparing MD5 sums. An MD5 sum is sort of a 'digital fingerprint' of a file. The directory from which you downloaded the ISO image from should contain a text file which lists these fingerprints. Download this file (it's just a few bytes) and put it into the same directory as the images. You then run the 'md5sum' command, which is installed by default on Linux systems: md5sum *.iso This command computes the MD5 sums of the images you downloaded. It usually takes a few minutes. Now compare the computed values to the numbers listed in the 'md5sum_file' which contains the MD5 sums these images had on the remote server. If they match, everything's OK and you can proceed (you don't have to compare all the numbers, if the first and last four match, the rest should be fine, too). In order to check if a CD image has been burned correctly to the CD, put the CD into your drive and run df -k /mnt/cdrom to get the block count (the number listed under '1k-blocks'). Now umount the CD as 'root' with umount /mnt/cdrom and run this command: dd if=/dev/cdrom count=block_count bs=1024 | md5sum Replace block_count with the number you got from the first command. The number you get from this should match the corresponding number in the checksum file you downloaded.
Notice that unmounting the CD is necessary for 'dd' to work correctly. This will however turn off 'supermount' on that drive for the rest of your current session. (Thanks to doug_s for this bit.) section index - top
Burning CD-Images
The standard tool for burning CDs in Linux is cdrecord. You only use 'cdrdao' for burning audio CDs to get rid of the 2 seconds pause between tracks or to burn cue/bin images. Burning an image from the hard disk to CD works like this: cdrecord -v -eject speed=XX dev=x,y,z cd_image.iso- '-v': 'Verbose' switch. This enables the progress indicator. Optional. * '-eject': Eject disk after burning. Optional. * 'speed=XX': Speed factor (i.e. either 4, 8, 12, 16 etc). If you don't know the speed of your CD burner, use '20' (without quotes). 'cdrecord' will automatically adjust this number to the capabilities of your hardware. * 'dev=x,y,z': These three numbers tell 'cdrecord' which device to use. Run
alias biso='cdrecord -v -eject speed=12 dev=0,6,0'
Burning CD-Images under Windows
If you use Windows you need a program like Nero Burning ROM and the option 'burn ISO image' to burn your CDs from an ISO-image file. Under Windows-XP CD-burning is already implemented in the operating system. But you need to install the software ISO Recorder Power Toy to burn and create ISO images. This will give you the CD context menu entries 'Copy CD to Image File' and 'Copy CD to CD'. section index - topRelated Resources:
CD-Writing HOWTOCD Writing Tutorial
man cdrecord
man mkisofs Revision / Modified: Mar. 4, 2002 / Mar. 11, 2002
Author: Gerard Gilbert and Tom Berger Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.
Welcome to Mandriva Club Knowledge Base > Installation > Handling CD-Images
Version 1.10 last modified by Theophanis on 17/03/2007 at 11:06
Version 1.10 last modified by Theophanis on 17/03/2007 at 11:06
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!
Mandriva.com
Store
Club




