View previous topic :: View next topic |
Author |
Message |
psy_ill Tux's lil' helper
Joined: 06 Jul 2003 Posts: 106
|
Posted: Fri May 20, 2005 9:11 am Post subject: Howto mount iso as non-root user |
|
|
I've seen this topic on other threads, but noone solved it exactly as I think it should be done, so here comes the full procedure:
- Make sure you have enabled the loopback device in kernel
- If you choose to compile the loopback device as a module, you need to make sure it loads at bootup
- Add the following rows to your /etc/fstab:
Code: |
# To mount .iso-files
/tmp/cdimage/tmp.iso /mnt/iso iso9660 noauto,ro,user,loop 0 0
|
Create the directory /tmp/cdimage
Put the following two scripts somewhere in your $PATH:
isomount.sh
Code: |
#!/bin/bash
MOUNTFILE="$1"
# Convert relative paths to absolute
MOUNTFILE=$(cd `dirname "$MOUNTFILE"` && pwd)"/"`basename "$MOUNTFILE"`
MOUNTLINK="/tmp/cdimage/tmp.iso"
ln -sf "$MOUNTFILE" "$MOUNTLINK"
mount "$MOUNTLINK"
|
isoumount.sh
Code: |
#!/bin/bash
MOUNTLINK="/tmp/cdimage/tmp.iso"
umount "$MOUNTLINK"
rm "$MOUNTLINK"
|
Set the file mode for the scripts so that you can execute them
Done! With the command
Code: |
isomount.sh foo.iso
|
the iso-file foo.iso will be mounted at /mnt/iso and with the command
it will be unmounted. |
|
Back to top |
|
|
anima1 n00b
Joined: 27 Dec 2004 Posts: 1
|
Posted: Fri May 20, 2005 9:42 am Post subject: hmm |
|
|
nice try, but how does it work when two users mount iso at the same time? |
|
Back to top |
|
|
psy_ill Tux's lil' helper
Joined: 06 Jul 2003 Posts: 106
|
Posted: Mon May 23, 2005 10:36 am Post subject: |
|
|
Since /tmp has the sticky bit set, only the user who created the softlink can remove it. So it does not matter if another user tries to create the softlink before the mounting fails, the softlink creation will fail too.
It will be like when another user tries to mount a cd which is already mounted. I understand your opinion though, because a cd must be considered as one limited resource but different iso-files should be mountable at the same time. It's still hard though to create mountpoints on-the-fly in /etc/fstab. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|