Mount ISO’s easely in gnome – nautilus

Sponsored Link
If you simply wish to right click and .iso and select mount follow this simple guide on how to use nautilus scripts to accomplish this:

Firstly create two scripts with mount_iso and unmount_iso

One for mount iso and another one for unmount iso

.ISO Mount Script
Create mount_iso file or download this file from here
vi .gnome2/nautilus-scripts/mount_iso

or

gedit .gnome2/nautilus-scripts/mount_iso

Add the following save and exit
#!/bin/bash
#

gksudo -u root -k /bin/echo "got r00t?"

sudo mkdir /media/"$*"

if sudo mount -o loop -t iso9660 "$*" /media/"$*"
then
if zenity --question --title "ISO Mounter" --text "$* Successfully Mounted.

Open Volume?"
then
nautilus /media/"$*" --no-desktop
fi
exit 0
else
sudo rmdir /media/"$*"
zenity --error --title "ISO Mounter" --text "Cannot mount $*!"
exit 1
fi

.ISO UnMount Script
Create unmount_iso file or download this file from here

vi .gnome2/nautilus-scripts/unmount_iso

or

gedit .gnome2/nautilus-scripts/unmount_iso
Add the following save and exit

#!/bin/bash
#

for I in "$*"
do
foo=`gksudo -u root -k -m "enter your password for root terminal
access" /bin/echo "got r00t?"`

sudo umount "$I" && zenity --info --text "Successfully unmounted /media/$I/" && sudo rmdir "/media/$I/"
done
done
exit0

Now change the permissions on the two files

sudo chmod 755 ~/.gnome2/nautilus-scripts/*_iso

Restart gnome

ctrl+alt+back_space

Select an ISO image, right click and select scripts then select mount_iso

Sponsored Link

You may also like...

11 Responses

  1. Red Five says:

    These scripts didn’t work for me at all on Gutsy. But I fixed them.

    mount_iso:
    #!/bin/bash

    for I in “$@”
    do
    if [ ! -e /media/”${I%.iso}” ]
    then gksudo mkdir /media/”${I%.iso}”
    fi
    if sudo mount -o loop -t iso9660 “$I” /media/”${I%.iso}”
    then
    nautilus –no-desktop /media/”${I%.iso}”
    exit 0
    else
    gksudo rmdir /media/”${I%.iso}”
    zenity –error –title “ISO Mounter” –text “Cannot mount $I!”
    exit 1
    fi
    done

    unmount_iso:
    #!/bin/bash

    for I in “$@”
    do
    I=”${I%.volume}”
    gksudo umount /media/”$I”
    gksudo rmdir /media/”$I”
    done
    exit 0

  2. Lutfi says:

    I’m using this and can mount/unmount iso image for all user:

    http://mundogeek.net/nautilus-scripts/#nautilus-mount-image

    It’s provide .deb file

  3. nitr8 says:

    thanks Red Five,

    do you mind if I update the article to include yours?

    –me

  4. Ibod Catooga says:

    I mounted yo’ mama in Linux. It didn’t take no script, just some Pabst Blue Ribbon.

  5. Jeffrey Seguerra says:

    I use gmountiso for mounting iso.

  6. Red Five says:

    Sure, Nitr8, go ahead.

  7. joruss says:

    Also, no need to ctrl-alt-backspace, just kill nautilus and it’ll restart automatically.

  8. andrea says:

    How do I create an icon in nautilus an image mounted in /mnt/imageloop ?
    I can not move the mount point on /media

  9. NeoZiggy says:

    Thanks guys. I was searching for a GUI program, but this is just as good, if not better.

    Andrea: I’m guessing your trying to make a launcher for the mounted image?
    Right-click on your desktop, select ‘Create Launcher’, then add the appropriate information (I believe the command would be “nautilus /mnt/imageloop”, without the quotes.), then click the icon box in the top left and pick an icon.
    If not, google around or ask on your distro’s support forums. (ubuntuforums.org for me)

  10. Benjamin says:

    Hi, thanks a lot for the scripts. They work nicely. Great work.

    However, there are few little mistakes that are easy to fix: in the second script, there’s one “done” too much and it’s “exit 0” not “exit0”. Then, in both scripts, if you copy directly, the line ends are not correct and the double quotation marks are not the correct ones (do they come from some windows program?).

  11. Anders says:

    In my world, nothing is “easy” if it requires to write a script. It doesnt matter how easily understood the script is.

    Its “easy” if it requires a right click menu choice.

Leave a Reply

Your email address will not be published. Required fields are marked *