I need to mount a disk image located on an NFS network share without copying it first.
Only a non-root user (
apache) on the RHEL 5 machine I'm on has permissions to access the files on that network share.
sudo mount /
sudo losetup both didn't work, as I lose permission to access the files. Adding an
/etc/fstab entry with
user flag didn't work either.
chmod ugo+rw on the network share also failed.
Is there any way to
mount these disk images without copying them first?
Doing what @Malvineous suggested:
$ losetup -o 512 /dev/loop7 img.img /dev/loop7: Permission denied # chown apache:apache /dev/loop7 $ losetup -o 512 /dev/loop7 img.img memlock: Cannot allocate memory Couldn't lock into memory, exiting.
Doing the exact same thing as root works.