How to make a bootable ISO from a bootable DVD using the command line?

Solution 1:

I found here how to do it using the dd command and as far as I can tell it will work for any bootable media.

The command below created a bootable DVD image of my Windows 7 installation disc from the Ubuntu command line:

dd if=/dev/cdrom of=/output/path/forYourImage.iso bs=2k

Note 1: the generated image will only be bootable if the source media is bootable.

Note 2: in my case, since I was on a headless server, I first used sudo lshw -c disk to find out where on /dev/ my cdrom drive was located.

Note 3: also in my case, the cdrom was not mounted so I had to mount it with sudo mount /dev/sr0 /cdrom

Solution 2:

To create a bootable ISO image, you have to specify to the command that you want this. By default, the ISO image you will create won't be bootable.

With genisoimage, you can use the following command line : genisoimage -b isolinux/isolinux.bin -c isolinux/isolinux.cat -r -J -o cd_image.iso /cdrom

Assuming that a directory called isolinux has been created under the root of your source directory from which you create the ISO file.

The file isolinux.cat will be created by the command, this is a catalog needed for the boot loader. The file isolinux.bin is the image of a bootloader, valid for a CD or DVD. These images are available in the syslinux package. Check that you have this package installed, if not perform

sudo apt-get install syslinux-common

Under /usr/share/syslinux you will find a predefined bootload, the file isolinux.bin.

More info on the official web site of Syslinux (generic Linux information)