How to create iso file from CD/DVD-ROM on Linux/BSD/UNIX

Sometime you might need to back up your CD/DVD-ROM of Windows, Linux, or any other operating systems installer. The easiest way to backup them is to copy to other CD/DVD-ROM, but it is also better to backup them in an .iso file image. In Windows there are many third party softwares to do this job such as WinISO, MagicISO, etc. But how to do this job in Linux/BSD/UNIX?

It is much easier to do this in Linux/BSD/UNIX and the tool is already installed by default in the system as part of fileutils package. Simply you can use ‘dd’ to convert and copy a file. Based-on the dd manual, ‘dd’ copies a file (from standard input to standard output, by default) using specific input and output blocksizes, while optionally performing conversions on it.

In this tutorial we will use the ‘dd’ command to create an iso file from CD/DVD-ROM.
How to do that? Here are the steps.

1. Insert the source CD/DVD-ROM that you want to backup and convert it to an .iso file. Make sure it is not mounted. If your system mounted it automatically, unmount it first. In Linux/UNIX, the CD/DVD-ROM should be in /dev/cdrom.

2. Run the following command to start creating an iso file

dd if=/dev/cdrom of=targetfile.iso

For example, I created an iso file from a Windows 7 DVD as follow:

$ dd if=/dev/cdrom of=Windows7.iso
5203584+0 records in
5203584+0 records out
2664235008 bytes (2.7 GB) copied, 386.03 s, 6.9 MB/s

Your iso file will be created in your current working directory. It is just as simple as that. Later you can burn the iso file to CD/DVD-ROM.