kdand919
Posts: 10
Joined: Wed Mar 11, 2015 2:40 am

Automount Permissions

Sun Apr 26, 2015 4:47 pm

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

User avatar
DougieLawson
Posts: 37742
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Automount Permissions

Sun Apr 26, 2015 5:07 pm

If the drive is formatted as FAT then ownership and permissions / masks are set on the mount command.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

kdand919
Posts: 10
Joined: Wed Mar 11, 2015 2:40 am

Re: Automount Permissions

Sun Apr 26, 2015 5:19 pm

format is NTFS. Is there a file I can edit to change the default permissions when a device is first mounted?

User avatar
DougieLawson
Posts: 37742
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Automount Permissions

Sun Apr 26, 2015 6:25 pm

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?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

kdand919
Posts: 10
Joined: Wed Mar 11, 2015 2:40 am

Re: Automount Permissions

Sun Apr 26, 2015 6:44 pm

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.

User avatar
DougieLawson
Posts: 37742
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Automount Permissions

Sun Apr 26, 2015 7:15 pm

Then you need to look at how Kodi handles auto mounting USB drives. I've never used that so I can't help.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

RobHenry
Posts: 452
Joined: Fri Sep 21, 2012 9:04 pm
Location: UK

Re: Automount Permissions

Sun Apr 26, 2015 7:46 pm

What operating system are you running underneath Kodi? Openelec, OSMC, Raspbmc, or a general purpose OS such as Raspbian?

kdand919
Posts: 10
Joined: Wed Mar 11, 2015 2:40 am

Re: Automount Permissions

Sun Apr 26, 2015 9:13 pm

Using Raspbmc on this one:

Code: Select all

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

RobHenry
Posts: 452
Joined: Fri Sep 21, 2012 9:04 pm
Location: UK

Re: Automount Permissions

Sun Apr 26, 2015 9:44 pm

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...

amilino
Posts: 96
Joined: Fri Feb 05, 2016 6:01 pm

Re: Automount Permissions

Sat Jan 20, 2018 9:57 am

I cannot find /etc/autofs on my Raspbian Stretch. Any clue where is that automount configuration file located?

Return to “Media centres”