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

Incoming search terms:

Related posts

11 thoughts on “Mount ISO’s easely in gnome – nautilus

  1. 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

    [Reply]

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

    [Reply]

  3. 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)

    [Reply]

  4. 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?).

    [Reply]

  5. 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.

    [Reply]

Leave a comment

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