Mounting .iso files as CDs/DVDs in Linux

Okay, it’s been a while since the last time i wrote anything, so im gonna start again!!!

I’m pretty sure some of you had to burn .iso files just to use the cd on the same PC! That’s a waste of CDs! Surely there is a way to mount them without burning them on CDs/DVDs!

You got three choices there, either to install an application, use a bash script or do it manually! Of course  the application should be faster than the script, but for such jobs, there shouldn’t be a noticeable difference! And doing it manually would be the easiest for me since it’s only one command: mount -o loop -t iso9660 file.iso /mountpoint where the mount point is any directory!

Application Installation
To install the application i ehich found very promising, just click this!!! could be also installed by sudo apt-get install gmountiso

All you have to do next is to goto Applications –> System Tools –>Gmount-iso which would give you something like this

Bash Script
Now although i wasted my time to create my own, before peeking at the interwebz, i will give you a better one since mine isnt finished (not planing to continue that)!

#!/bin/bash
# mount
gksudo -k /bin/echo "got r00t?"
BASENAME=`basename $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS .iso`
sudo mkdir "/media/$BASENAME"
zenity --info --title "ISO Mounter" --text "$BASENAME e $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
if sudo mount -o loop -t iso9660 $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS "/media/$BASENAME"
then
if zenity --question --title "ISO Mounter" --text "$BASENAME Successfully Mounted. Open Volume?"
then
nautilus /media/"$BASENAME" --no-desktop
fi
exit 0
else
sudo rmdir "/media/$BASENAME"
zenity --error --title "ISO Mounter" --text "Cannot mount $BASENAME!"
exit 1
fi

now, download this script and set is as executable. either by GUI or CLI. For GUI, preform a right click –> properties –> permissions –> Allow execution as a program! for CLI, nothing better than chmod +x mount.sh!!

Now you use this script by double clicking or you can put it in the right click menu! to get it there just move the file to ~/.gnome2/nautilus-scripts/ directory! So now when you preform a right click on a file you’ll get

So enjoy, and if you’re a windows dual-booting person, #windows recommends daemon tools!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.