LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Mount a cd image as a user (https://www.linuxquestions.org/questions/slackware-14/mount-a-cd-image-as-a-user-859795/)

Vlad420 01-31-2011 11:01 AM

Mount a cd image as a user
 
Sorry if this has been answered before somewhere else but all I have been able to find is how to add things to fstab.
Is there a way to allow a user to use the mount command without adding a specific entry to the fstab
-or-
Is there sompthing I can add to allow a user to mount anything to a specific point such as a private folder in their home directory
I am currently using slackware 13.1

szboardstretcher 01-31-2011 11:31 AM

To mount a cd-image,.. you would:

Code:

mkdir /mnt/cdrom
mount -o loop redhat-6.iso /mnt/cdrom


manwichmakesameal 01-31-2011 01:23 PM

@szboardstretcher: Those commands will not let a normal user mount a loopback image. I'm pretty sure that you would have to edit /etc/sudoers for mounting images on loopback.

Keith Hedger 01-31-2011 01:28 PM

you need to use sudo for these two commands to work if you are not root
Code:

sudo mkdir -p /mnt/cdrom
sudo mount -o loop redhat-6.iso /mnt/cdrom

the -p switch to mkdir creates the parent directory's as well

ponce 01-31-2011 01:29 PM

If I remember well I have configured this in the past adding the user to the disk group (yes, sometimes I'm just rude :D )
Code:

$ ls -la /dev/loop*
brw-rw---- 1 root disk 7, 0 gen 31 08:55 /dev/loop0
brw-rw---- 1 root disk 7, 1 gen 31 08:55 /dev/loop1
brw-rw---- 1 root disk 7, 2 gen 31 08:55 /dev/loop2
brw-rw---- 1 root disk 7, 3 gen 31 08:55 /dev/loop3
brw-rw---- 1 root disk 7, 4 gen 31 08:55 /dev/loop4
brw-rw---- 1 root disk 7, 5 gen 31 08:55 /dev/loop5
brw-rw---- 1 root disk 7, 6 gen 31 08:55 /dev/loop6
brw-rw---- 1 root disk 7, 7 gen 31 08:55 /dev/loop7

but that is definetely a bad idea. :)

here you can find a pair of good advices ;)

Vlad420 02-01-2011 12:25 AM

Quote:

Originally Posted by manwichmakesameal (Post 4243743)
@szboardstretcher: Those commands will not let a normal user mount a loopback image. I'm pretty sure that you would have to edit /etc/sudoers for mounting images on loopback.

I would say thats probably my best option but wow thats gonna take a while to figure out

Nikosis 02-01-2011 06:21 AM

Yes, there is, but there are good reasons for fstab, it keeps it short & safe, of course if you want to mount anything anywhere, I would suggest editing sudoers, using visudo.

Code:

$ visudo
{username} ALL = /sbin/mount, /sbin/umount

or if you don't want to type in your passwd everytime
Code:

{username} ALL = NOPASSWD: /sbin/mount, /sbin/umount
from that point you can mount anything anywhere
Code:

sudo mount ...{anything}...{anywhere}

Vlad420 02-02-2011 02:59 AM

Quote:

Originally Posted by Nikosis (Post 4244501)
Yes, there is, but there are good reasons for fstab, it keeps it short & safe, of course if you want to mount anything anywhere, I would suggest editing sudoers, using visudo.

That sounds good but just so I'm clear on this I need both the username and ALL in the line not one or the other right?

Daedra 02-02-2011 03:04 AM

a little less elegant, but you could try fuseiso.
http://slackbuilds.org/repository/13.1/system/fuseiso/

gnashley 02-02-2011 08:55 AM

You could also use archivemount.

linus72 02-02-2011 09:21 AM

I use Isomaster
http://www.littlesvr.ca/isomaster/

get it from slackbuilds or sbopkg
http://slackbuilds.org/repository/13...tem/isomaster/

guanx 02-02-2011 11:20 AM

mountlo should work. I tried it a few weeks ago.

Hangdog42 02-02-2011 11:47 AM

I use pmount to mount as a normal user. There is even a Slackbuild for it.

mrclisdue 02-02-2011 11:51 AM

Quote:

Originally Posted by guanx (Post 4246028)
mountlo should work. I tried it a few weeks ago.

...learned something new today....

cheers,

Nikosis 02-03-2011 12:16 AM

Quote:

Originally Posted by Vlad420 (Post 4245517)
That sounds good but just so I'm clear on this I need both the username and ALL in the line not one or the other right?

Yes, that's correct, you need both, username and ALL (ALL represents host, but you can use hostname instead).


All times are GMT -5. The time now is 12:35 PM.