LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Unable to Automount ISO image unless automount is running in foreground! (http://www.linuxquestions.org/questions/linux-general-1/unable-to-automount-iso-image-unless-automount-is-running-in-foreground-654622/)

swests 07-09-2008 10:38 AM

Unable to Automount ISO image unless automount is running in foreground!
 
Hi all

I've been battling this for a week or so and am starting to get really ()&&&$"!(* with it.

What am I trying to do:
Use automount to mount ISO's on demand - kinda like a CD/DVD jukebox. I got the idea from this article http://www.linuxjournal.com/article/5639.

How:
Stick .iso files in a directory (/iso/images/test.iso, etc.)
update autofs files to mount as iso9660, readonly, etc...

Problem:
I get a "permissions denied" message for the .iso image in /var/log/messages when automount is running in the background. It works when automount is run in foreground with -f.

I'm running CentOS 2.6.18-92.el5.

/etc/auto.master contains
/misc /etc/auto.misc
/net -hosts
/isomnt /etc/auto.isomnt --timeout=60
+auto.master

/etc/auto.isomnt contains
xx -fstype=iso9660,ro,loop :/iso/images/test.iso
/var/log/messages shows the generated mount command as
mount -t iso9660 -s -o ro,loop /iso/images.test.iso /isomnt/xx
followed by
>> /iso/images/test.iso: Permission denied



I can't seem to figure out which combination of rights I need and where!

Any ideas?

Thanks

S.

doublejoon 07-09-2008 12:43 PM

I would mount the ISO images as loopback devices on the server first. Then just share the mounted loopback directory

mount -o loop someimage.iso /ISO1

In /etc/exports
/ISO1


Automounter might be happier this way

swests 07-10-2008 03:56 AM

@doublejoon
I could but I'm looking for a solution that will scale as I add more ISO images. The plan is for this box to hold ISOs of my DVD collection and I want then to automount on demand. If I pre-mount then I start to hit kernel resource issues when I really don't need to. In reality, at worst 5 images will be mounted, but this is from a pool of 100's... Hence needing to fix the security issue.

Frankly3D 07-12-2008 06:31 AM

Quote:

Originally Posted by swests (Post 3209819)
@doublejoon
I could but I'm looking for a solution that will scale as I add more ISO images. The plan is for this box to hold ISOs of my DVD collection and I want then to automount on demand. If I pre-mount then I start to hit kernel resource issues when I really don't need to. In reality, at worst 5 images will be mounted, but this is from a pool of 100's... Hence needing to fix the security issue.


The post is old but maybe this maybe the way to go:
http://ubuntu.wordpress.com/2005/10/...unt-iso-files/

spiralofhope 05-22-2009 12:47 AM

I realize this is a response to an ancient thread. However, I had this very same problem and I was able to solve it, but in another way.

I'm on PCLinuxOS 2007/2009 and it has PAM installed. I did this:

Code:

su
ln -s /usr/bin/consolehelper /usr/bin/mount-root
cp /etc/pam.d/synaptic /etc/pam.d/mount-root
ln -s /bin/mount /usr/sbin/mount-root

Then I was able to make a script like so:

Code:

echo mount-root -o loop test.iso /mnt/iso>>isomount.sh
Where "test.iso" is the name of a valid ISO.

I then executed it like so:

Code:

sh ./isomount.sh
I was given a prompt for the password. The mount command worked as-expected.

Of course, I also needed a similar umount command, like so:

Code:

su
ln -s /usr/bin/consolehelper /usr/bin/umount-root
cp /etc/pam.d/synaptic /etc/pam.d/umount-root
ln -s /bin/umount /usr/sbin/umount-root

Perhaps this will help the next person who searches this forum and bumps into this thread.


All times are GMT -5. The time now is 11:09 AM.