Piiiiiiiiiiiiiii
Posts: 8
Joined: Tue Nov 24, 2015 2:00 am

How to change the permission on the auto mounted USB drive?

Fri Feb 05, 2016 1:15 am

I am trying to get nzbget to work with the external USB drive, and it's failing to work as a service when it's relying on the USB drive. I suspect that the permissions that the service runs with don't mesh with the permission that the drive is mounted with. In the command below "Vault" is my USB drive.

Code: Select all

pi@raspberrypi:/media/pi $ ls -la /media/pi
total 37
drwxr-x---+ 4 root root  4096 Jan 25 16:25 .
drwxr-xr-x  3 root root  4096 Nov 21 21:36 ..
drwxr-xr-x  5 root root  1024 Jan  1  1970 SETTINGS
drwx------  1 pi   pi   28672 Oct 22 00:14 Vault
How can I just make it writable to anyone?

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: How to change the permission on the auto mounted USB dri

Fri Feb 05, 2016 3:10 am

As noted in man mount you can use umask etc. what type of file system are you using?
Related:
q&a,
fstab,
chmod
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

Piiiiiiiiiiiiiii
Posts: 8
Joined: Tue Nov 24, 2015 2:00 am

Re: How to change the permission on the auto mounted USB dri

Fri Feb 05, 2016 2:07 pm

The disk is formatted as NTFS.
Here's the output of running mount

Code: Select all

/dev/mmcblk0p6 on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=469748k,nr_inodes=117437,mode=755)
sysfs on /sys type sysfs (rw,relatime)
none on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/cgroup type tmpfs (rw,relatime,size=4k,mode=755)
none on /sys/kernel/debug type debugfs (rw,relatime)
none on /run type tmpfs (rw,nosuid,noexec,relatime,size=94812k,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
none on /run/shm type tmpfs (rw,nosuid,nodev,relatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755)
cgmfs on /run/cgmanager/fs type tmpfs (rw,relatime,size=100k,mode=755)
/dev/mmcblk0p5 on /boot type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/usr/lib/arm-linux-gnueabihf/systemd-shim-cgroup-release-agent,name=systemd)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=94812k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
//192.168.1.18/Vault on /mnt/oevault type cifs (rw,relatime,vers=1.0,cache=strict,domain=WORKGROUP,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.18,unix,posixpaths,serverino,mapposix,acl,rsize=1048576,wsize=1048576,actimeo=1,_netdev)
/dev/sda1 on /media/pi/Vault type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/mmcblk0p3 on /media/pi/SETTINGS type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
My drive is on /dev/sda1. What command do I need to run?

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: How to change the permission on the auto mounted USB dri

Sat Feb 06, 2016 1:03 pm

If it's an NTFS filesystem you can't change permissions after it's mounted that would only work with an EXT filesystem. If it's FAT or NTFS you have to designate ownership and permissions at the time it's mounted.

When you say "auto mounted USB" that would imply that you always plug the drive in after the Pi is running, and the system mounts it automatically. Or is it being mounted at boot using fstab?

Piiiiiiiiiiiiiii
Posts: 8
Joined: Tue Nov 24, 2015 2:00 am

Re: How to change the permission on the auto mounted USB dri

Sat Feb 20, 2016 12:21 am

The system mounts the drive automatically.

In fstab, i only mount the SMB share

Code: Select all

pi@raspberrypi:~ $ cat /etc/fstab
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p5  /boot           vfat    defaults          0       2
/dev/mmcblk0p6  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
//192.168.1.18/Vault /mnt/oevault/ cifs guest,uid=1000,gid=1000,iocharset=utf8,_netdev 0 0
pi@raspberrypi:~ $

Return to “Raspberry Pi OS”