Thursday, October 24, 2013

Creating an ISO image

Create a cdrom image
sudo dd if=/dev/cdrom of=cd.iso

Create a dvd image
sudo dd if=/dev/dvd of=dvd.iso

Create a scsi cdrom image
For a SCSI CDROM image, your device is probably called /dev/scd0
sudo dd if=/dev/scd0 of=cd.iso

Create an ISO image from files in a directory
To create an ISO image from files within a directory is just as simple. State an output directory and name of the ISO to create, along with a source directory. For example:
mkisofs -o /home/linuxlookup/example.iso /source/directory/

Another way to make any Linux directory into an ISO file:

mkisofs -V LABEL -r DIRECTORY | gzip > cdrom.iso.gz

Using GENISOIMAGE to Create ISO-9660 CD-ROM filesystem
sudo apt-get install genisoimage

To create a vanilla ISO9660 filesystem image of directory:
genisoimage -o cd.iso cd_dir

In the next command the -r and -J ensures long file names work for Unix (using Rock Ridge) and Windows (using Joliet extensions).
genisoimage -r -J -o cd_image.iso /directory

Mounting an image

mkdir -p /mnt/isoimage

mount -o loop -t iso9660 cd.iso /mnt/isoimage


Unmounting

umount -lf /mnt/isoimage