2008-09-29. From: http://www.linux-gamers.net/modules/wiwimod/index.php?page=HOWTO+CD-IMAGES This information was obtained when wondering about ripping more than just the ISO type of image, or about mounting any of the plethora of weired CD-image formats that exists on the internet. `cdrdao' sounds good for getting whole CD images. The rest of this rather good page is copied here, in case of desire to rip things when away from the network! **** 2. CD specifications - A 74 min CD consists of 333,000 sectors, a 80min CD of 360,000. - A sector is 2352 bytes, which corresponds to 2048 bytes of PC (MODE1) Data, 2336 bytes of PSX/VCD (MODE2) Data or 2352 bytes of AUDIO. The variable number of bytes in a sector result of different header sizes and different error correction codes of those modes. - When extracting data from a CD in RAW format, you always get 2352 bytes per sector, ignoring in which mode the data is formated on CD. **** 3. Handling with .iso files Creating an .iso file is the easiest way to create an image from a CD and mount it into the linux filesystem; Just insert the cd into your cd-drive and copy all data from the device file to any file: # cat /dev/cdrom > /path/to/the/image.iso or # dd if=/dev/cdrom of=/path/to/the/image.iso To mount it, you have to ensure that the loopback device driver (in kernel "make menuconfig" "Device Drivers -> Block devices -> Loopback device support") is enabled as module or built in, what should be the case in all standard kernels. Now just enter this command as root to mount your .iso file: # mount -o loop -t iso9660 /path/to/the/image.iso /path/to/mountpoint The option "-t iso9660" can usually be left out, because the mount program guesses the right filesystem automatically. BUT with the creation of an .iso image only data files of the iso9660 filesytem are copied. Thus there are no error correction codes and headers copied, also there's no possibility to copy a cd consisting of multiple data or audio tracks, you'll just get the iso9660 formated data. The only advantage of creating an .iso file instead of copying the data manually from the mounted cd, is that the bootable block of the CD is also copied to the image. So the .iso format is great for purposes like holding a collection of distribution CDs. But e.g. PlayStation cds consist normally of more than one track, so an .iso image wouldn't work here. Burning an .iso file works with following command: # cdrecord -v dev=0,0,0 /path/to/the/image.iso To find the right device use the command: # cdrecord -scanbus **** 4. Handling with .bin/.cue/.toc files The advantage of .bin/.cue image files is, that it is a "RAW" copy of the cd. What means, that every bit (including header and error correction) is copied to the image file. Generation of such a RAW CD copy can easily be done with cdrdao: # cdrdao read-cd --read-raw --datafile /path/to/image.bin --device ATAPI:0,0,0 --driver generic-mmc-raw /path/to/image.toc The command generates the image.bin, the RAW copy of the CD and a image.toc file, which just contains information about the different tracks in the image. Some programs need exactly this information, but formated in a .cue file. The program bin2iso can be used to get such a .cue file from the image. # bin2iso /path/to/image.cue -c /path/to/image.bin The correct device for the cdrdao command can, like in the section above, be found with: # cdrecord -scanbus The disadvantage of the .bin/.cue format is, that it can't be mounted into the linux filesystem with standard kernels. You need the kernelmodule and program of the http://cdemu.sourceforge.net/. Howto get this thing working is described later in this document. Burning a CD of a .bin file works this way: # cdrdao write --device ATAPI:0,0,0 /path/to/image.toc **** 5. Installing cdemu As already mentioned, there is a module and a program needed to mount .bin/.cue files. A project which supports us with such a program and kernelmodule is called http://cdemu.sourceforge.net. The latest version supports .mds, .ccd and .nrg files as well. The following instructions are for compiling cdemu from source, if there's a distribution specific cdemu package you may download it and skip the whole compiling process. Before you continue reading, ensure that you installed the sources of your running kernel and things you need to compile, like the gcc compiler, autotools and so on! Get the package from http://prdownloads.sourceforge.net/cdemu/cdemu-0.8.tar.bz2 Extract: # tar xvfj cdemu-0.8.tar.bz2 Build it: # cd cdemu-0.8# make If you get the error: /cdemu.c:211: error: too few arguments to function 'do_generic_file_read' you simply have to add a ",0" to line 211 of cdemu.c: the original line: do_generic_file_read(vc->backing_file, &position, &desc, cdemu_read_actor); the "patched" one: do_generic_file_read(vc->backing_file, &position, &desc, cdemu_read_actor,0); Install it (as _root_!): # make install If you've got a distribution which uses udev (e.g. fedora, suse,..) you should add following line to /etc/udev/rules.d/50-udev.rules: KERNEL="cdemu[0-9]*", NAME="cdemu/%n", MODE="0666" The module can be loaded using modprobe (you should insert this command somewhere that it is executed everytime you boot your system, for fedora you can add it to the file /etc/rc.local): # modprobe cdemu After you inserted the module, the device files /dev/cdemu/0 - /dev/cdemu/7 should be created. **** 6. Loading .bin images To load a .bin image into a "virtual" CD-drive you need the correct .cue file. If you don't have it, have a look into the section "3. Handling with .bin/.toc/.cue files". Cdemu supports 8 devices for loading imagefiles, to load the 3. device, just enter: # cdemu 2 /path/to/image.cue The argument "2" stands for the device number, in this case the image can be accessed at /dev/cdemu/2. To unload the image, enter: # cdemu -u 2 And to get the status of loaded CD images execute: # cdemu -s **** 7. Conversion between different types of images ** .nrg (Nero image) to iso: [the original document gave this, i.e. remove first 2048*150 bytes] # dd if=/path/to/image.nrg of=/path/to/image.iso bs=2048 skip=150 [but this didn't work on one example, and Wikipedia (on NRG format) says it shouldn't (necessarily): the format is (can be) more complex; nrg4iso or nrg2iso are useful here (nrg4iso is claimed to support the format fully, nrg2iso not)] ** .bin (RAW CD copy) to iso: # bin2iso /path/to/image.cue /path/to/extract/ or # bchunk /path/to/image.bin /path/to/image.cue NameOfGeneratedIso ** .mdf (alcohol 120%) to iso: install http://mdf2iso.berlios.de/ and execute: # mdf2iso image.mdf