OT?: non-root use of mount to loop mount filesystem images?

Joseph M Dupre (AVAB Inc.) dupre at avab.com
Wed Oct 19 00:06:16 UTC 2005


I hope this isn't too far off topic.  I figure some of you may have 
attacked this issue before:

Does anyone know how (or if it is even possible) to allow a non-root 
user to configure and mount a loop device to whatever mount point 
they choose?

On my development machine I typically do not login as root for the 
obvious reasons.  But to mount a filesystem image with the command 
below I have to be root:

# mount -o loop=/dev/loop0 rootfs.image /some/mount/point

I'd rather not have to 'su' everytime I need to mount a device.

Using fstab to allow non-root users to mount specific devices is less 
than ideal for the above because it "fixes" the mount point to a 
single location.  And worse, it still requires root to set up the 
loop device with the losetup command.
 
I thought that if I gave my non-root login read/write access to the 
loop devices, then I would be able to mount them as non-root.  But 
even with access to the loop devices mount fails with "only root can 
do that."

- Joe 



More information about the uClibc mailing list