Can't mount iso files

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
hoe

Re: Can't mount iso files

Post by hoe »

Why are you trying to mount an ISO ? ... right click on it and select "Open With" and select Open With "Brasero Disk Burning" . If per chance you are in Windose you will have to uses Nero or whatever.

Wayne
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
garda

Re: Can't mount iso files

Post by garda »

You do not need any additional utilities to mount and unmount ISO files in Mint. Follow this guide:

1. Create a file called 'mount iso' in ~/.gnome2/nautilus-scripts/ directory

Code: Select all

gksu gedit ".gnome2/nautilus-scripts/mount iso"
2. Paste this script into the file:

Code: Select all

#!/bin/bash
#

gksudo -u root -k  "ISO Mounter"

sudo mkdir /media/"$*"

if sudo mount -o loop -t iso9660 "$*" /media/"$*"
then
if zenity --question --title "ISO Mounter" --text "$* Successfully Mounted.

Do you want to open the mounted volume?"
then
nautilus /media/"$*" --no-desktop
fi
exit 0
else
sudo rmdir /media/"$*"
zenity --error --title "ISO Mounter" --text "Cannot mount $*!"
exit 1
fi
3. Save the file and close Gedit.
4. Create a file called 'unmount iso' (this would be the unmount script) in the same directory as 'mount iso':

Code: Select all

gksu gedit ".gnome2/nautilus-scripts/unmount iso"
5. Paste the following script into the file:

Code: Select all

#!/bin/bash
#

for I in "$*"
do
foo=`gksudo -u root -k -m "this operation requires administrative 
privileges" /bin/echo "please enter administrator password"`

sudo umount "$I" && zenity --info --text "/media/$I/ has been succesfully unmounted" && sudo rmdir "/media/$I/"
done
done
exit0
6. Save the file and close gedit.
7. Change the access permissions for each of the scripts:

Code: Select all

sudo chmod 755 ".gnome2/nautilus-scripts/unmount iso"

Code: Select all

sudo chmod 755 ".gnome2/nautilus-scripts/mount iso"
8. Restart X (Press CTRL+ALT+Backspace) and log back in.

To mount ISO's:
1. Open up Nautilus, navigate to your ISO file and right-click on it.
2. From the pop-up menu, choose Scripts > mount iso

To unmount ISO's:
1. Open up Nautilus, navigate to your ISO file and right-click on it.
2. From the pop-up menu, choose Scripts > unmount iso

Important:
You can not unmount the ISO by right-clicking on the mounted image in Nautilus' sidebar and choosing Unmount. You must go to the location (i.e. directory) where you keep your ISO and right-click on it instead.

Hope that helps.

Edit: Based on your kernel ring message, I suspect you have a faulty (as in corrupted) or non-standard ISO format. Hence if the method I described above does not work, you will probably need to re-download or rebuild the ISO.
User avatar
det4100
Level 4
Level 4
Posts: 222
Joined: Mon Dec 10, 2007 9:51 am
Location: New York

Re: Can't mount iso files

Post by det4100 »

garda,
I tried out your script for mounting ISO's. I was able to mount the iso with no problem. However, I can't seem to unmount it. I navigate back to the folder where the ISO is, right click and choose to unmount. I'm asked for a password and after entering the password, nothing happens. ISO is still mounted. The ISO is not located in my home folder. It is located on a partition mounted at media/disk. Could this be the problem?

det4100
det4100

Running Mint Debian
garda

Re: Can't mount iso files

Post by garda »

Did you rename the ISO file while it was mounted?

The mount script attaches an ISO to /media/iso-file-name/ directory, while the unmount script is meant to detach a given ISO from /media/iso-file-name/ directory. If the ISO file is renamed while it is still mounted, the unmount script will attempt to detach an ISO from non-existent directory.

Here is a more detailed illustration:

You mount, for example, a file called 'live_disc'. The mount script then mounts it to /media/live_disc/ directory. The unmount script, when executed, will then attempt to detach it from the very same path, /media/live_disc/. Everything should work normally under this situation.

If the ISO file is renamed to 'Live Disc' while it is still mounted, the unmount script will then attempt to detach a mounted media from the /media/Live Disc/ path--which is non-existent. This is equivalent to executing the unmount script for an unmounted ISO.
User avatar
det4100
Level 4
Level 4
Posts: 222
Joined: Mon Dec 10, 2007 9:51 am
Location: New York

Re: Can't mount iso files

Post by det4100 »

garda,

I didn't rename the ISO after mounting. I took a look at the scripts folder and can see the two scripts there with locks on them. The icons appear different for each script, so I checked the properties. The properties for mount iso, under type : plain text document (text/plain). For unmount iso under type: shell script (application/x-shellscript). I'm not too skilled at script writing and stuff but I found it odd that the mount script worked as a text file and the unmount didn't work. I suspect that this may be the problem. I probably didn't follow the directions closely enough. :oops:
det4100

Running Mint Debian
garda

Re: Can't mount iso files

Post by garda »

but I found it odd that the mount script worked as a text file and the unmount didn't work
That is very odd indeed.

I have tried following my own guide (copying and pasting command lines and the scripts from my previous post) and I found both scripts working fine as expected. So there is a great possibility that you did something wrong in the process--not sure what it was.

I do notice that the lines in the scripts are indented if you click 'Select all' in the code box and paste them to Gedit. That might also cause problem. Thus all I can recommend is to delete both scripts, follow my guide from the beginning, and manually highlight the scripts and command lines--instead of clicking on 'Select all'.
User avatar
det4100
Level 4
Level 4
Posts: 222
Joined: Mon Dec 10, 2007 9:51 am
Location: New York

Re: Can't mount iso files

Post by det4100 »

I tried deleting the files and starting over. Both files are now listed as shell/scripts but unmount still does not work. Not a big deal, It works when I reopen nautalis as root. Then I can right click the volume and unmount it. Very odd though. I'll try moving the ISO to a local folder instead of mounting it from a different volume to see if it makes a difference.

det4100
det4100

Running Mint Debian
garda

Re: Can't mount iso files

Post by garda »

I have tried to simulate a few conditions that could possibly cause the scripts to not work as intended. So here are some suggestions I could come up with:

1. Remove spaces and non-alphanumeric characters (with the exception of dashes, underscores and periods) from the ISO file name (if any). This is just a hypothetical thinking, as all of my ISO's file names have spaces (but not non-alphanumeric characters other than the three mentioned) and they can be mounted and unmounted without a hitch.
2. Try to change the scripts' access permission with this command instead:

Code: Select all

sudo chmod +x '.gnome2/nautilus-scripts/unmount iso'; sudo chmod +x '.gnome2/nautilus-scripts/mount iso'
Or this one:

Code: Select all

cd /; sudo chmod +x "/home/`whoami`/.gnome2/nautilus-scripts/unmount iso"; sudo chmod +x "/home/`whoami`/.gnome2/nautilus-scripts/mount iso"
Note that `whoami` in the second one-liner is not to be replaced with anything--paste and execute the command as it is.
3. If you ever set your sudo timeout to zero, try setting it to anything higher than zero. Based on my tests, both scripts fail to function if sudo timeout is set zero. If you ever tried a guide similar to that in this post, you should have got the idea.

Those are all I can think of right now.
User avatar
det4100
Level 4
Level 4
Posts: 222
Joined: Mon Dec 10, 2007 9:51 am
Location: New York

Re: Can't mount iso files

Post by det4100 »

garda,

I tried your suggestions. The ISO itself has no spaces or non alpha numerical characters. DVDS1.ISO is the file name. I tried both CL suggestions. I even moved the file from the disk it was on, into my home partition. Didn't seem to work. I can unmount it by opening the folder as root. It was just odd that it would not unmount with that script. My sudo timeout is not set to zero. Not a big deal, I don't expect to be mounting many ISO's, I just thought it was a neat shortcut. Still do think it''s a neat shortcut.

det4100
det4100

Running Mint Debian
Locked

Return to “Beginner Questions”