Re: HOWTO: Nautilus Script to mount .iso files
I used these scripts, posted by animacide, with no problems at all in dapper.
Mount:
Code:
#!/bin/bash
#
# 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
Unmount:
Code:
#!/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
Here is a step by step.
First open a terminal and do a:
Code:
sudo gedit ~/mount-iso
I used root to create the files so there was no conflicts later. Then in the empty file I cut and pasted the mount script and saved with crtl-s and exit.
Then the same for Unmount script:
Code:
sudo gedit ~/unmount-iso
Then in this empty file cut and paste the unmount script. Save with
crtl-s and exit.
Ok next to make them executable do a:
Code:
sudo chmod +x ~/mount-iso
and then:
Code:
sudo chmod +x ~/unmount-iso
Ok now to put them in the right spot:
Code:
sudo mv ~/mount-iso ~/.gnome2/nautilus-scripts/
next:
Code:
sudo mv ~/unmount-iso ~/.gnome2/nautilus-scripts/
And thats it.
Now to use the new scripts find and .Iso or .Nrg anywhere you have it. I've mounted both types from my ntfs storage partition with no problems. Just right click the image file go to scripts and then choose mount or unmount. Could'nt get any better than that. Goodluck and if you need more fuctions or just want to try some other scripts check the UDSF Here.
Edit: It doesn't work with img's on the desktop.
Re: HOWTO: Nautilus Script to mount .iso files
The animacide's script can "only" mount iso / nrg image in the home directory...if you put your iso file in ~/Desktop for example you can't mount it...
Bye
Aragorn
Re: HOWTO: Nautilus Script to mount .iso files
Well animacide's script is the only one I use and it mounts my images from everwhere but the desktop strange. And that even includes my windows partition. Sorry yours did'nt work like that but I just did it last nite maybe it's been edited since you used it, I don't know, as I said I just did it. And decided to post the results and the way I did it. Give it another go, ;) However I did just find there's this one nrg I cant mount on my ntfs partion, but all the rest are fine.
Re: HOWTO: Nautilus Script to mount .iso files
Really strange. Rattyman has the same problem and the $* in the original script doesn't get the right path in all the directory. Can you try to put an iso image in the ~/Desktop direcoty and mount it?
Bye
Aragorn
Re: HOWTO: Nautilus Script to mount .iso files
Yea, I dont get it either. Maybe it has something to do with the mount icon having the exact same name as the image does, and it causes some conflict, is what I'm guessing. I'm no programmer but at first site that seems to be it. I tried the other script that suppose to take the .iso part off the mounted image icon with no success. O well I'll just use the home folder, its less work when I'm in terminal anyway "~/".:-k Hey wait, just thought of something else, I could change the mount directory itself from /media/ to /mnt/ that would probably solve it. O well it works for what I need it for.
Re: HOWTO: Nautilus Script to mount .iso files
this is great cause most of my movies are .iso
and i could only mount them under *******
thanks mate
btw vlc somehowe manages to play isos without having to mount them..
1 Attachment(s)
Re: HOWTO: Nautilus Script to mount .iso files
Hi,
I use something similar with nautilus actions and fuseiso instead of mountloop. The advantage is that you don't need a sudo.
add yourself in fuse group
Code:
sudo adduser $USER fuse
load fuse module do only once
make fuse load on startup you don't need modprobe fuse the next time
Code:
echo fuse >> /etc/modules
logout and relog to gnome (it's needed to enter the group)
Code:
sudo apt-get install fuseiso fuse-utils
Then import the *.schemas file with nautilus actions.
Put the scripts fuseisomount and fuseisumount in ~/bin/
Code:
cp fuseismount fuseisoumount ~/bin
chmod them executable with
Code:
cd ~/bin
chmod u+x fuseismount fuseisoumount
Then in nautilus after maybe a restart of nautilus, you right click on an iso, and do mount.
The iso will be mounted in /tmp/nameoftheiso/
probably /media/ would be a better place, you can change the script.
To unmount, left click the iso and do unmount.
The name of the actions are in french, "monter" = "mount", "démonter" = "unmount", you can rename them.
:-D
edit:
To have the iso in /media, do
sudo chmod o+rwt /media/
This gives the bahavior of /tmp to /media, users can create anything they want but can not delete others files.
I realised that in /media the drive_mount applet show the iso unlike in /tmp I think.
Re: HOWTO: Nautilus Script to mount .iso files
I've already written a Nautilus-script to mount ISO files. It can handle special characters, and can mount ISO files located in any directory.
How to mount ISO BIN/CUE IMG/CCD NRG:
http://ubuntuforums.org/showthread.php?t=149963
http://ubuntuforums.org/showthread.php?t=144236
Re: HOWTO: Nautilus Script to mount .iso files
Quote:
Originally Posted by
Nightwish
No, those are defective :P
gksu segfaults with -k root, i don't think it needs it anyway. also, it attempted for me to create directories with the full path, which is not what i want. so, here's a quick fix and a cleanup.
Mount:
Code:
#!/bin/bash
#
# nautilus-mount-iso
gksudo -k /bin/echo "got r00t?"
BASENAME=`basename "$*"`
sudo mkdir /media/"$BASENAME"
echo $BASENAME
if sudo mount -o loop -t iso9660 "$*" /media/"$BASENAME"
then
if zenity --question --title "ISO Mounter" --text "$BASENAME Successfully Mounted.
Open Volume?"
then
nautilus /media/"$BASENAME" --no-desktop
fi
exit 0
else
sudo rmdir /media/"$BASENAME"
zenity --error --title "ISO Mounter" --text "Cannot mount $BASENAME!"
exit 1
fi
Unmount:
Code:
#!/bin/bash
#
BASENAME=`basename "$*"`
foo=`gksudo -u root -k -m "enter your password for root terminal access" /bin/echo "got r00t?"`
sudo umount /media/"$BASENAME" && zenity --info --text "Successfully unmounted /media/$BASENAME/" && sudo rmdir "/media/$BASENAME/"
cleaned up the unmount code, BTW.
Here's an easy fix to get rid of the .iso from mounted images.
Replace:
Code:
BASENAME=`basename "$*"`
with:
Code:
BASENAME=`basename "${1%.*}"`
That's just string chopping. It tells the shell to cut off anything after the (.).
Edit: The umount script does'nt work if the directory name does'nt have the .iso on it so here's the fix.
Code:
#!/bin/bash
#
ImgDir="${1%.*}"
for I in "$1"
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/$ImgDir"
done
done
exit0
Re: HOWTO: Nautilus Script to mount .iso files
Quote:
Originally Posted by
animacide
You'll want to save these under ~/.gnome2/nautilus-scripts/ and make them executable:
I'm new to Linux and this is probably a stupid question, but how do I make the file an executable?
Also, is there any script to be able to open .ccd, .img and the other types of image files?