Page 1 of 1

Automount Permissions

Posted: Sun Apr 26, 2015 4:47 pm
by kdand919
Could someone let me know where I can find and edit the permissions that are set when an external hard drive or thumb drive is attached to the raspberry pi. When I plug in a hard drive to my pi it gives the permissions :

drwx------ 1 pi pi

Is there a way to change it so that it automatically gives read permissions the group "pi" or to everyone. I know I can set each device up to mount with a given set of permissions but this doesn't work for new devices. I wish to plug a new device into my pi and have some other user be able to read the files without setting everything up.

Thanks in advance,
Kyle

Re: Automount Permissions

Posted: Sun Apr 26, 2015 5:07 pm
by DougieLawson
If the drive is formatted as FAT then ownership and permissions / masks are set on the mount command.

Re: Automount Permissions

Posted: Sun Apr 26, 2015 5:19 pm
by kdand919
format is NTFS. Is there a file I can edit to change the default permissions when a device is first mounted?

Re: Automount Permissions

Posted: Sun Apr 26, 2015 6:25 pm
by DougieLawson
How does it get mounted? Do you have a /etc/fstab entry? Are you using a mount command? Or is the GUI auto-mounting it?

Re: Automount Permissions

Posted: Sun Apr 26, 2015 6:44 pm
by kdand919
I do not have an fstab entry setup for any of the devices I plan on using:

Code: Select all

proc            /proc           proc    defaults         0       0
devpts          /dev/pts        devpts  rw,nosuid,noexec,relatime,gid=5,mode=620        0       0
/dev/mmcblk0p1  /boot           vfat    defaults,noatime         0       0
/dev/mmcblk0p2  /               ext4    defaults,noatime 0       0
I do have xbmc/kodi on my raspberry pi which I assume would be managing the mounting of a connected device (not sure if that's correct though). What I have done in the past was setup an fstab entry for a specific device so that I can change the permissions when it is mounted but I do not wish to do this everytime a new device is connected. I want the default permissions to allow read access to all users and if I want something different in the future, then I can always go back and change that device separately.

thanks.

Re: Automount Permissions

Posted: Sun Apr 26, 2015 7:15 pm
by DougieLawson
Then you need to look at how Kodi handles auto mounting USB drives. I've never used that so I can't help.

Re: Automount Permissions

Posted: Sun Apr 26, 2015 7:46 pm
by RobHenry
What operating system are you running underneath Kodi? Openelec, OSMC, Raspbmc, or a general purpose OS such as Raspbian?

Re: Automount Permissions

Posted: Sun Apr 26, 2015 9:13 pm
by kdand919
Using Raspbmc on this one:

Code: Select all

pi@raspbmc:/$ uname -a
Linux raspbmc 3.12.31 #2 PREEMPT Wed Oct 29 09:24:56 UTC 2014 armv6l GNU/Linux
pi@raspbmc:/$ cat /proc/version
Linux version 3.12.31 (root@raspbmcbb-legacy) (gcc version 4.7.1 20120402 (prerelease) (crosstool-NG 1.15.2) ) #2 PREEMPT Wed Oct 29 09:24:56 UTC 2014
pi@raspbmc:/$ cat /scripts/upd_hist/build_info
raspbmc-rls-1.0-hardfp-b20130208-u20150125
pi@raspbmc:/$

Re: Automount Permissions

Posted: Sun Apr 26, 2015 9:44 pm
by RobHenry
I'm not sure what raspbmc uses to automount USB drives, but if it's autofs you will find the default configuration files in /etc/autofs - there should be a template in there specifying default mount options.

Hope this sets you off in the right direction as I don't use raspbmc myself so don't have a system to check...

Re: Automount Permissions

Posted: Sat Jan 20, 2018 9:57 am
by amilino
I cannot find /etc/autofs on my Raspbian Stretch. Any clue where is that automount configuration file located?