Read/Write access denied with mounted drives?

Having issues with your DietPi installation, or, found a bug? Post it here.
User avatar
WarHawk
Posts: 610
Joined: Thu Jul 20, 2017 8:55 am

Re: Read/Write access denied with mounted drives?

Post by WarHawk »

I'm at a loss...hopefully someone from the DEV team can assist
User avatar
finch_6
Posts: 30
Joined: Tue Sep 04, 2018 7:21 pm

Re: Read/Write access denied with mounted drives?

Post by finch_6 »

Thanks for the help though @WarHawk

Anyone from the DEV team monitoring the thread???
DietPi on a Raspberry Pi 3 B+ running:
- Sonarr
- Deluge
- Jackett
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: Read/Write access denied with mounted drives?

Post by MichaIng »

@finch_6
Sorry for the late attention. I opened an issue about it on Github to force a solution in v6.15 release, or at least to find a workaround for your case to apply: https://github.com/Fourdee/DietPi/issues/2067

I never really used network drives, so can just guess what could be a reason that your chown/chmod attempts failed:
- Can you check if the file system of the Samba server actually supports permissions? E.g. usual Windows file systems NTFS and FAT do not support the POSIX permissions that you apply on Linux systems via chown/chmod. An NTFS drive directly attached to a Linux system at least does not support it. I am now not sure, how this is handled in case of network drives, but it makes sense that it is the same there.
- A thinkable solution, that goes hand in hand with the case, that ls -al actually shows root:root and 755 permissions, is that somehow by the mount driver just Samba client side, permissions are applied. Possibly one can change those permissions via some Samba/mount settings. In this case we would need to change the permissions client-side to dietpi:dietpi 775 (or 770), which would allow read/write access for Sonarr and other software.

About what changed with v6.12:
- For security and consistency reasons we switched several software titles to run not as root user any more, but as an own user. E.g. Sonarr now runs as user sonarr, with limited access to the /mnt/dietpi_userdata directory and it's own install, config and data directories of course.
- We solved cross access (Media players => downloader directories, downloaders => network share (Server!) dirs and such) via dietpi user group. Sonarr runs as dietpi group (sonarr:dietpi) which allows read/write access to shares, download and media dirs etc.
- But to be true, we did not yet think about network mounts, just about cases where the DietPi system is network share server :roll:. And if permissions cannot be applied, this is a further difficulty, as above.
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Read/Write access denied with mounted drives?

Post by Fourdee »

Hi,

I don't believe Samba supports setting file/folder permissions, as the permissions used are set during the mount, as defined by the server:
https://github.com/Fourdee/DietPi/issue ... -420568750
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
D0NN13DARK0
Posts: 1
Joined: Fri Sep 14, 2018 8:45 pm

Re: Read/Write access denied with mounted drives?

Post by D0NN13DARK0 »

i"m having the exact same issue with a mounted Samba share, from the terminal i can create folders etc. but none of the services i installed (sonarr, radarr, sabnzbdplus) are able to create files on the /mnt/share i tried to play with some setting withing the /etc/fstab file but so far no luck , is there a way to change the users these services are running on?
User avatar
finch_6
Posts: 30
Joined: Tue Sep 04, 2018 7:21 pm

Re: Read/Write access denied with mounted drives?

Post by finch_6 »

Updated to v6.15 yesterday and still no joy with this...?

Still getting the same error...


@MichaIng, Im busy working on answers to your questions :lol: :lol:
Im not a boffin with this stuff, just know enough to get by...

Seems this all started when the permissions where changed from root to sonarr.. wish it was just as easy as changing back...

:? :? :?
DietPi on a Raspberry Pi 3 B+ running:
- Sonarr
- Deluge
- Jackett
User avatar
finch_6
Posts: 30
Joined: Tue Sep 04, 2018 7:21 pm

Re: Read/Write access denied with mounted drives?

Post by finch_6 »

@MichaIng, @Fourdee,

Since this wasn't resolved in v6.15, is there any way to "roll back" to a version of DietPi that didn't have this issue??
At least until it is resolved???

Im all for having the latest version of any software (even test builds), but this is one I'd rather go back to an older version until its fixed..
DietPi on a Raspberry Pi 3 B+ running:
- Sonarr
- Deluge
- Jackett
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Read/Write access denied with mounted drives?

Post by Fourdee »

finch_6 wrote: Sat Sep 15, 2018 9:00 pm

Since this wasn't resolved in v6.15, is there any way to "roll back" to a version of DietPi that didn't have this issue??
At least until it is resolved???

Im all for having the latest version of any software (even test builds), but this is one I'd rather go back to an older version until its fixed..
Hi,

Unfortunately, it is not possible to roll back to a previous DietPi version, unless you have a DietPi-Backup of the system, which can be used to restore.

I'll run some local testing in regards to trying to find a solution for samba as userdata folder, with non-root account access.
https://github.com/Fourdee/DietPi/issue ... -421752937

Failing the above, i'll give you information in regards to setting the run-level user for those applications to root (which will make some "security" aware users cry :))
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
User avatar
finch_6
Posts: 30
Joined: Tue Sep 04, 2018 7:21 pm

Re: Read/Write access denied with mounted drives?

Post by finch_6 »

Fourdee wrote: Sun Sep 16, 2018 1:58 pm
finch_6 wrote: Sat Sep 15, 2018 9:00 pm

Since this wasn't resolved in v6.15, is there any way to "roll back" to a version of DietPi that didn't have this issue??
At least until it is resolved???

Im all for having the latest version of any software (even test builds), but this is one I'd rather go back to an older version until its fixed..
Hi,

Unfortunately, it is not possible to roll back to a previous DietPi version, unless you have a DietPi-Backup of the system, which can be used to restore.

I'll run some local testing in regards to trying to find a solution for samba as userdata folder, with non-root account access.
https://github.com/Fourdee/DietPi/issue ... -421752937

Failing the above, i'll give you information in regards to setting the run-level user for those applications to root (which will make some "security" aware users cry :))
Hi @Fourdee,

Thanks for the reply. I look forward to any solution possible, thank you!!
DietPi on a Raspberry Pi 3 B+ running:
- Sonarr
- Deluge
- Jackett
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: Read/Write access denied with mounted drives?

Post by MichaIng »

@finch_6 @Fourdee
I found a solution 8):

Code: Select all

sed -i 's/,iocharset=utf8,vers=/,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=/g' /etc/fstab
umount /mnt/samba
mount -a
ls -al /mnt/samba
NB: Replace /mnt/samba with the actual mount location.
The above sets user (uid) and group (gid), as well as global file and directory permissions for the whole samba share.
dietpi:dietpi 770 should allow r/w access for Sonarr and such, as these software titles run as their own user, but as dietpi group.
umount and remount is needed to apply the changes, then check via ls -al.
Somehow external guides mention that as well Samba server side there need to be changes done, but it worked here to create a totally new user, set it as uid+gid, remount and access + create files with this user within the mount.

@Fourdee
I think we should set this as default for samba mounts, to allow access for our download and media software?
I am going to find out how to achieve the same for nfs mounts.
Post Reply