hocuspokus

Mount ISO Files With Nautilus

November 14, 2007

Here’s two short bash scripts that allow you to mount and unmount an ISO image easily within the right-click menu in Nautilus (the file manager in Gnome):

sudo mkdir /media/ISO
cd ~/.gnome2/nautilus-scripts/
gedit “Mount ISO Image”

Now paste this code into the file:

#!/bin/bash
#
for I in </span><span class="nb">echo</span> <span class="nv">$*</span><span class="sb">
do
foo=</span>gksudo -u root -k -m <span class="s2">"enter your password for root terminal access"</span> /bin/echo <span class="s2">"got r00t?"</span><span class="sb">
sudo mount -o loop -t iso9660 $I /media/ISO
done
done
exit0

Save, and exit gedit.

gedit “Unmount ISO Image”

Then paste this code in this file:

#!/bin/bash
#
for I in </span><span class="nb">echo</span> <span class="nv">$*</span><span class="sb">
do
foo=</span>gksudo -u root -k -m <span class="s2">"enter your password for root terminal access"</span> /bin/echo <span class="s2">"got r00t?"</span><span class="sb">
sudo umount $I
done
done
exit0

Save, and exit gedit. Now finally…

chmod a+x *

Now you can mount and unmount ISO files by using the ‘Scripts’ options in the right-click menu. :)

Thanks to the Ubuntu Blog for the information.

Comments