[HOW TO] Create and Mount ISOs in Linux

Creating as well as mounting (i.e. using) ISOs (exact image of an optical disk) is very easy and straight-forward in Linux (generally in any UNIX system).
By the way: this does (should) also work on OS X.

We are going to use the tools dd (byte-wise copying), du (to check the filesize) and mount.

First, let us create an ISO:

dd if=/dev/cdrom of=/home/user/myimage.iso
# if -> Input File
# of -> Output File
# for further options have a look at 'man dd'

When the command has completed, we can check the size of the generated file:

du -h ~/myimage.iso
# Example output: 750M myimage.iso

Great, we have successfully created an ISO.
To actually use the ISO, we need to mount it (attach it to the directory tree):

sudo mount ~/myimage.iso /media # you can mount the file to any location you like

Note: the directory to which you are attaching the file to should be empty. If /media is not empty,
create a subdirectory and mount it there.

We can now access the files at the previously defined location:

ls /media
content/ of this/ image

That's it!
Hope this helps.

Edit: added various links

2 Likes