Page 1 of 1

setting permissions to a usb/nas mount

Posted: Thu Apr 18, 2013 8:08 am
by goldfoxweb
I have set up 2 mount points on my pi 1 to a 32gb usb pen drive (mount /dev/sde1 /mnt/usb) and 1 to my nas (mount -t cifs //192.168.0.x/share /mnt/nas -o username=user,password=password)

The mounts are carried out by script called from the rc.local file that is run as soon as the pi powers on this the script is used to detect if the nas is up and running and if not mount the usb pen drive as a temp data store. this work well.

The problem I have is that I can only write to the devices if I am logged in as root but when logged in as a user (pi) I can see and read the directory’s and files but I can't write or create files. I have tried to set the permissions from SCP and locally but no joy.

I have set up a new mount point set it to full permissions for everyone (777) but as soon as I mount a device on it the permissions change to full for root and read only for the rest (755).

Is there any way I can mount the devices so that everyone gets full access.

Thanks in advance,
Adam

Re: setting permissions to a usb/nas mount

Posted: Thu Apr 18, 2013 11:09 am
by FTrevorGowen
goldfoxweb wrote: ...
The mounts are carried out by script called from the rc.local file that is run as soon as the pi powers on this the script is used to detect if the nas is up and running and if not mount the usb pen drive as a temp data store. this work well.
Adam,
The more common approach to auto-mounting at boot time with set permissions is to edit and add suitable entries within /etc/fstab. Given your desire to check for the nas I can understand why you may not have done so. However, IIRC, "mnt" checks that file whenever it's used so it still may be useful to modify it. Just in case you're not familiar with that approach one of my webpages at http://www.cpmspectrepi.webspace.virgin ... ticks.html discusses some ideas about the auto-mounting of multiple USB sticks and also links to some info. in the wiki.
Trev.

Re: setting permissions to a usb/nas mount

Posted: Thu Apr 18, 2013 11:31 am
by goldfoxweb
thanks for that, i will give that a read and respond if need be.

I have found a solution for the NAS mount. If I add uid=pi option to the end of the mount command it allows me to access the directories and files as pi user.

(mount -t cifs //192.168.0.x/share /mnt/nas -o username=user,password=password,uid=pi)

thanks for the help,

Adam