Linux Basics: Mount An ISO File As A Directory

August 23rd, 2011 Leave a comment Go to comments

On other operating systems, there exist tools that allow you to mount an ISO file and view the contents without having to burn it to an optical disc. Fortunately, this facility is built-in to Linux, and it’s pretty easy to use once you know how. This mini-tutorial presumes that you are using Ubuntu Linux but most of it is applicable to other Linux distributions.

Ever been in a situation in which you’d like to look at the contents of an .ISO without burning the contents to a real disc? Fortunately, Linux has a built-in facility for mounting an ISO file that allows you to access the contents as though it was in a directory on your hard disk. This is thanks to the built in loopback filesystem. Unfortunately, there’s some out of date information floating around the Internet

First, create a directory that will be used to host the contents of the ISO file. Most tutorials insist that you create such a directory in the system designated location for mount points such as “/media” or “/mnt”, but actually, you can place the directory anywhere you like, which can save a lot of typing if you’re planning on working from the command line.

The command

mkdir ~/iso_mount

creates a suitable directory in your home directory.

mkdir isomount

creates a directory in the current directory.

Note that if you do want to create the mount point in the official location, you will need super user privileges, so instead use:

sudo /mnt/iso_mount

There’s a lot of old information floating around the internet about performing the actual mount operation, but using a modern distribution such as a recent version of Ubuntu, you only need a single mount command. Also, you don’t have to manually specify the filesystem (iso9660).

sudo mount -o loop mydisk.iso ~/iso_mount

You should now be able to access the contents of the ISO from the command line or via a file manager. To unmount the ISO, type

sudo umount <directory>

(c) 2010 Michael Reed
  1. No comments yet.
  1. No trackbacks yet.