Pramod’s world of reality

In quest of Knowledge and Wisdom

Archive for July, 2008

Mounting .iso images manually in Ubuntu (using the terminal)

Posted by Pramod on July 3, 2008

I have been trying to mount .iso images on my Ubuntu these last days, i looked over the internet and found many solutions, including some ready made scripts and even some applications which help mount iso images, an example is Gmount-iso. I really did not like the way it mounts since when i mount it i have to create a folder on the Desktop and mount it there itself. I looked for some scripts and i tried using them but i was still not able to mount them.

Finally while searching for another solution i ended up on this site which had both ways of mounting the iso image. One way was to use the Nautilus Script which i was really not satisfied and the second way was mounting it manually through the gnome terminal using the Kernel Loop Module.

First let’s see what the Kernel loop module does as it stated in the site:

Using the module loop it is possible to mount a filesystem file. squashfs is a “loop” with (de)compression (Compressed Loopback Device) and it is possible to mount a compressed filesystem like a block device and seamlessly decompress its data while accessing it.

So, firstly we need to load the loop module. Open the terminal and type in:
sudo modprobe loop

Root access is needed so you will be prompted for your root password.

A folder is then created in the /media/ directory (This folder is the mount point of the .iso image) using:

sudo mkdir /media/anyname

“anyname” can be replaced by any name of your choice.

Now we need to mount the .iso image file.

To make my task easy, i open Nautilus (the ubuntu file browser) and navigate to where the .iso file is found. I then Right-Click -> Copy then return to the terminal and type in:

sudo mount

and after a space i just press Ctrl+Shit+V or Simply Right-click on the terminal background and paste. The path and the filename will already be pasted thus:
sudo mount path_and_filename.iso

and further we type in the mount point of the .iso image in this case: /media/anyname/ followed by -t iso9660 loop where “iso9660″ specifies the type of image file being mounted. There on the whole the code will look like this:
sudo mount path_and_filename.iso /media/anyname/ -t iso9660 -o loop

The iso image is now mounted and accessible from the desktop in the form of a CD/DVD icon :)

Well after using our mounted .iso file we need to unmount it in order not to leave tasks incomplete (just a small discipline):
sudo umount /media/anyname

Then we simply delete the mount point that we created:
sudo rmdir /media/anyname

I found this a bit more practical even if we got a lot to type but it allows me to create a mount point of my choice without any problem and really flexible…

Well i really want to create an application which will help me implement this using a gnome gui… or maybe there is already one (definitely not Gmount-iso since it does not let me create any folder int the /media/ directory-premission denied)

Any suggestion and help are welcome. ;) This small implementation will help out a lot and save a lot of time and do some clean jobs. :)

Posted in Linux | Tagged: , , | 10 Comments »