[conspire] Mounting iso with Gnome

David E. Fox dfox at m206-157.dsl.tsoft.com
Thu Nov 23 20:45:59 PST 2006

On Tue, 21 Nov 2006 17:14:42 -0800
John Andrews <jla1000 at comcast.net> wrote:

> jla at jla-desktop:~/.gnome2/nautilus-scripts$ ./iso-mount.bash
> bash: ./iso-mount.bash: Permission denied

Is the script executable? chmod +x iso-mount.bash

(and shell scripts usually have a "sh" extension, or none at all, but
there's no hard and fast rule).

> jla at jla-desktop:~/.gnome2/nautilus-scripts$ sudo ./iso-mount.bash
> Password:

Or it could be that the script is executable only as root, but that
isn't a nice idea, and unnecessary, if we examine the script:

> cat: iso-mount.bash: Permission denied
> jla at jla-desktop:~/.gnome2/nautilus-scripts$ gksudo gedit iso-mount.bash

If you can't read the script, it would seem the permissions of the file
are just plain wrong.

> sudo mkdir /media/"$I" 
> sudo mount -o loop -t iso9660 "$I" /media/"$I" && nautilus /media/"$I"
> --no-desktop 

It seems that sudo is done inside the script, so I don't see any need
why you'd need or want root permission to execute the script in the
first place. 

But if we look at the second line - that's the guts of how you want to
mount an iso. To do that, we use the loop device (-o loop) which
transparently lets you look at the iso - it mounts the content
transparently on a file / directory of your choosing. 

Your first parameter is of course the name of the iso you wish to mount
- and you didn't supply that. You should have invoked ./iso-mount.bash
"name of iso" (substitute of course the name of the iso). The script
would automatically mount the iso on /media/"name of iso" and open a
nautilus browser window for that iso.

David E. Fox                              Thanks for letting me
dfox at tsoft.com                            change magnetic patterns
dfox at m206-157.dsl.tsoft.com               on your hard disk.

More information about the conspire mailing list