Nautilus Script to Mount ISO files October 24, 2005
Posted by Carthik in ubuntu.trackback
David Carney, subscriber to the ubuntu-users mailing list had shared the following script to enable mounting ISO cd images from within the Nautilus File Manager, by right-clicking on the iso file to be mounted. You have to create a /media/ISO directory before you can use the script. For more details on how to install scripts for Nautilus, read the How to Install a Script part of the g-scripts faq.
I quote the entire mounting and unmounting script below:
MOUNT ISO FILES:
#!/bin/bash
#
for I in `echo $*`
do
foo=`gksudo -u root -k -m "enter your password for root terminal
access" /bin/echo "got r00t?"`
sudo mount -o loop -t iso9660 $I /media/ISO
done
done
exit0
UMOUNT ISO FILES:
#!/bin/bash
#
for I in `echo $*`
do
foo=`gksudo -u root -k -m "enter your password for root terminal
access" /bin/echo "got r00t?"`
sudo umount $I
done
done
exit0







Great blog!
Hope you can learn some things from mine too!
Ina
[...] Lea: Nautilus Script to Mount ISO files [...]
[...] Found a great little post over at the Ubuntu Blog on WordPress.com detailing two short bash scripts that allow you to mount and unmount an ISO image easily. [...]
You’re the first hit on google for “nautilus script mount iso”.
I was hoping to find something a little more feature complete (like the same script to mount/umount).
I ended up writing it myself:
#!/bin/bash
if (/usr/bin/gksudo -u root -k -m “enter your password to gain root privleges” /bin/echo “getting root”); then
for i in `/bin/echo $*`; do
if (/bin/mount | /bin/grep “$i”); then
# disk is mounted, umount
if ! (/usr/bin/sudo /bin/umount /mnt/”$i” && /usr/bin/sudo /bin/rmdir /mnt/”$i”); then
/usr/bin/zenity –error –text=”cant umount /mnt/$i and/or rmdir /mnt/$i”
exit 1
fi
else
# disk isn’t currently mounted
if ! (/usr/bin/sudo mkdir /mnt/”$i” && /usr/bin/sudo /bin/mount -o ro,loop -t iso9660 “$i” /mnt/”$i”); then
/usr/bin/zenity –error –text=”can’t mkdir /mnt/$i and/or mount $i”
exit 1
fi
fi
done
exit 0
else
exit 1
fi
My gksudo seems to be broken. Any ideas? When I try to launch anything requiring root access, I get the following:
Cannot launch entry
Details: Failed to execute child process “gksudo” (No such file or directory)
I’ve been using RedHat since veriosn 5, Fedora since its inception, and SuSE for the last year, and always used GNOME more then KDE, and I have, in these seven years, never seen this message before. Any thoughts (besides changing distros, which I won’t be doing because of work and time)?
I love the thought of Right-click -> Mount ISO, but so far no luck. I’m sure it’s because gksudo is broken. Currently using SuSE 10. I know it has something to do with my user profile. I just created a new user and launched an app requiring root, supplied the password, and the app opened. What’s my next step?
why are you using a dummy-sudo first? simply use gksudo for the command you want to use …
this didn’t work for me. i had to do this:
#!/bin/bash
quoted=$(echo -e “$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS” | awk ‘BEGIN {
FS = “\n” } { printf “\”%s\” “, $1 }’ | sed -e s#\”\”##)
foo=`gksudo -u root -k -m “enter your password for root terminal access” /bin/echo “got r00t?”`
eval “sudo mount -o loop -t iso9660 “$quoted” /media/ISO”
exit 0
and for unmounting:
#!/bin/bash
quoted=$(echo -e “$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS” | awk ‘BEGIN {
FS = “\n” } { printf “\”%s\” “, $1 }’ | sed -e s#\”\”##)
foo=`gksudo -u root -k -m “enter your password for root terminal access” /bin/echo “got r00t?”`
eval “sudo umount $quoted”
exit 0
The full Nautilus Scripts archive has two contest menu items for burning ISOs.
http://g-scripts.sourceforge.net/nautilus-scripts.tar.gz
great !! for burning :s this topic is about mounting
i used the script that is at the top, on Ubunt Dapper. Images will mount but won’t unmount. Unmounting yields and error about the device not being in FSTAB and that i’m not root.?!?
Two harddrives.
One with RedHat Ent WS3
The other with Ubuntu5.1
Neither will allow file access of the other.
The RedHat is partitioned in 3 parts, all primaries, Ext3 and swap.
The Ubuntu is paritioned with LVMM and data is stored in the extension, partition 5, which exists inside the primary partition #2. Parition 1 is readable by either filesystem, RedHat or Ubuntu, and mountable with no access to the root filesystem.
Why can’t ‘root’ read ‘root’ ?
i’m trying to unmount and mount an iso files, but I know nothing about computers. I was reading this blog and I have no idea whats going on.
Is there anyone who could possibly explain this process in a very simple way?
i have the same problem…
bug list:
1. can see the files from the virtual cd (iso) but cannot read them
2. can’t unmount
hop3 this gets better
I found this one and it worked great for me!
It’s made for debian though and, as a no0b I’m not aware if there will be conflicts with Ubuntu.
there’s just a slight problem with the line:
“sudo mv ~/mount-iso ~/.gnome2/nautilus-scripts/”
which should be:
“sudo mv ~/mount.sh ~/.gnome2/nautilus-scripts/”
unless you changed the file names. hope it helps someone…by the way, I have Ubuntu Edgy Eft.
ehehe…I forgot to put the URL on the last one..here it is!
http://www.debianadmin.com/mount-and-unmout-iso-images-without-burning-them.html
Derek Frye -> Awsome script! This taught me a lot about scripting in Linux =)
To anyone else trying it, don’t forget to replace all the double-quotes in the strings with new ones. They are messed up by the formatting and won’t work as is.
#!/bin/bash
drolitas=”$HOME/Rolitas/Iso-$(basename ${1})”
if [ -d "${drolitas}" ] ;then
gksudo -S -u root -k -m “Eit!!” /bin/echo “got r00t?”
sudo /bin/umount “${drolitas}”
else
mkdir -p “${drolitas}”
gksudo -S -u root -k -m “Eit!!” /bin/echo “got r00t?”
sudo /bin/mount -oloop “${1}” “${drolitas}”
fi
[...] to the Ubuntu Blog for the [...]
[...] read more | digg story [...]
Hey, if you are into contests there is a great contest on YouTube for Valentines Day. The contest is to create a video for the holiday. Actually its two contests, one is to make a video talking about your great love and the second is to actually do an online video proposal called “Will You Marry Me?” Here’s the URL http://www.youtube.com/greatestlovestories?cm_cid=twb8. Right now there are very few entries so you might have a good shot at winning.
inetbet casinò in linea
incorrect totalities documented attempted?armor.
credit repair help
messier whelp,market
online quotes for health insurance in missouri
scheme?MacMillan Houghton weasels
canada credit check
Teddy imagines coward store animation.
check my child credit
omissions quartets Vientiane
marketing specialists bankruptcy
admirer:Elinor not Barnes diffuses:
bingo bonus games
astronomically Marcello obviating modelings ideals delegates
alpha property and casualty insurance
molesting perpetrating processors
cheapest car insurance in uk…
fonts,aerosols vibrated dose …
miami paradise casino online…
annuls skirmishing Cincinnati diagonals:…
I saw your blog.
I also have the site concerning an online casino. Please link to this site.
http://online_casino.okuruma-kashite.com/