Mounting ISO images and creating shell scrips
Problem: Mount an ISO image file
- Good old terminal
$ sudo mkdir /media/iso && sudo mount -o loop image.isoTo unmount the ISO and clean up the /media directory
$ sudo umount /media/iso && sudo rmdir /media/isoAlways good to know the terminal commands, thanks nixCraft.
- Add a script to nautilus
$ cd ~/.gnome2/nautilus-scripts && sudo gedit mountAdd this text to make the ‘mount’ script
#!/bin/bashNow make the umount script
#
# nautilus-mount-iso
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
$ sudo gedit umountand here is the code
#!/bin/bashSet the files as executable
#
for I in “$"
do
foo=gksudo -u root -k -m "enter your password for root terminal<br />access" /bin/echo "got r00t?"
sudo umount “$I” && zenity –info –text “Successfully unmounted /media/$I/” && sudo rmdir “/media/$I/"
done
done
exit0
$ chmod 755 mount umountThis should have added the two new scripts to the context menu. Thanks to animacide @ ubuntu forums.
- Install gMount
$ sudo apt-get install gmountisoWhile it’s good to know the other methods this one is by far the easiest to use. Thanks gMount