The 12 Days of dd: Day Six
- Details
- Category: Blog
- Published on Tuesday, 30 December 2008 15:24
- Written by Brian Dykstra
- Hits: 376
On the sixth day of dd, we will create an image of a CD.
Before making an image, it is a good idea to make sure your CD drive is mounted as this can make the process faster. Use the following command to see what is currently mounted:
# mount
The generated output will look something like this:
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/sr0 on /mnt type iso9660 (ro)
Note the last line that has the type listed as "iso9660". This is the file system type for a CD. If you do not see this, your CD-rom drive is not mounted. In order to mount your drive, you need to know what the device name is. Execute the following commands:
# cd /dev
# ls
This will list the devices associated with your computer. Some common CD-rom devices are named "cdrom", "cd", "sr" , and "scd" any of which may be followed by a number (example: cdrom1). Once you have determined your devices name, you can execute the following command to mount it. For our example, we will be using "sr0" as our device name but you should replace it with whatever your computer's device name is.
# mount -t iso9660 /dev/sr0 /mnt
You should know see the following output:
# mount: block device /dev/sr0 is write-protected, mounting read-only
The CD-rom is now mounted. Now we can begin to create the image of the CD. Execute the following command:
# dd if=/dev/sr0 of=cd_image.iso conv=noerror,sync,notrunc
This is the standard command to create an image of a CD. We added our standard "conv" operand to deal with errors. It is possible to create an .iso image of a data CD this way so that it can be run as a regular CD or recorded onto another disc. Audio CD's are not recorded in the same format as a data CD and will report an input/output error if you try to image them with dd. Furthermore, dd can only handle single-session CDs. Using dd on a multi-session CD will generate a long string of errors.















