Read/Write access denied with mounted drives?

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

Re: Read/Write access denied with mounted drives?

Post by WarHawk »

Cool...so mounting it with the file_mode=0770,dir_mode=0770 sets it for read/write by non-root users?

Glad you guys showed up...I was at a complete loss
User avatar
finch_6
Posts: 37
Joined: Tue Sep 04, 2018 7:21 pm

Re: Read/Write access denied with mounted drives?

Post by finch_6 »

@MichaIng,

You are a super star! Thanks so much!! Worked perfectly. Back to a working setup again :) :)


Also a huge thank you to you @WarHawk for your help...

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 :))
Thanks @Fourdee for having the work around on standby!!
DietPi on a Raspberry Pi 3 B+ running:
- Sonarr
- Deluge
- Jackett
User avatar
MichaIng
Site Admin
Posts: 3089
Joined: Sat Nov 18, 2017 6:21 pm

Re: Read/Write access denied with mounted drives?

Post by MichaIng »

WarHawk wrote: Mon Sep 17, 2018 5:47 am Cool...so mounting it with the file_mode=0770,dir_mode=0770 sets it for read/write by non-root users?

Glad you guys showed up...I was at a complete loss
It allows r/w access for all users of the dietpi group, which includes all the software run users that we recently switched from root to their own separate ones for security reasons.

To allow r/w for really all users, 0777 modes would be needed, but this would break the security efforts ;).

Glad it works now. We will implement this as default for samba mounts via dietpi drive manager.

For those who use NFS mounts:
As long as the nfs servers file system supports permissions, you can apply them as usual via chown/chmod on server and client vice versa. I am going to test how to solve it, if the server does not support permissions.
pyro2677
Posts: 1
Joined: Tue Oct 23, 2018 12:42 am

Re: Read/Write access denied with mounted drives?

Post by pyro2677 »

I'm having the same issue and i have spent 10+hours over the last few days trying to get this sorted.
Had 6.14 everything was working as it should, updated to 6.16 and everything stopped working and i mean EVERYTHING. Dietpi wasn't even loading after the update. Reinstalled Dietpi onto my Odroid C2, it auto updated to 6.16 and then install all my programs again. Orginally i had plex.cred and this is how my fstab has been and working without issues before update.
#Please use DietPi-Drive_Manager to setup network mounts
//192.168.XX.XXX/video /mnt/samba cifs auto,defaults,nofail,credentials=/etc/plex.cred,uid=plex 0 0
//192.168.XX.XXX/music /mnt/samba_2 cifs auto,defaults,nofail,credentials=/etc/plex.cred,uid=plex 0 0
//192.168.XX.XXX/photo /mnt/samba_3 cifs auto,defaults,nofail,credentials=/etc/plex.cred,uid=plex 0 0

all 3 folders worked with qbittorrent, sonarr and Plex, mounts are on a synology NAS 6.14 i had to create a plex user to get it working. Sonarr and Qbittorrent ran without issue.

Installed 6.16 tried adding a new series then the problems started with Qbit starting D/L and then stopping them or running at 800bps - 1Kbps or not downloading at all and Sonarr would not rename files. Diving deeper it said not access to folder, added download station to the downloads client and ran full speed and downloaded files, however Sonarr couldn't move them.

I have tried setting up a new sonaar user in Synology Nas and giving it all the permissions the same as Plex but no luck. I have tried new permissions and changing permissions both in webmin and nas and still would not work. Changed folders to windows ACL still not accessed via Dietpi side. Made new folder on the NAS and moved Tv Shows to this new folder and still no go. Changed on dietpi side to dietpi:dietpi 0777,0775,0755 changed to plex:dietpi and still nothing. Also have tried changing the 0770 now on the mounts and nothing is changing anymore, staying at 0777.

Installed Sonarr on synology gave Sonarr sc-nzbdrone permission to the folder and boom everything working again as it should via the NAS side. There is something that has changed in Dietpi that is not working since the change.
Jargin
Posts: 1
Joined: Wed Dec 05, 2018 5:09 am

Re: Read/Write access denied with mounted drives?

Post by Jargin »

I'm lazy and went back to running as root. NFS share doesn't allow client side uid/gid settings.

In /etc/systemd/system/sonarr.service comment out the User and Group lines:

Code: Select all

[Unit]
Description=Sonarr (NzbDrone) Daemon
After=network.target

[Service]
#User=sonarr
#Group=dietpi
Type=simple
ExecStart=/usr/bin/mono -O=-aot /opt/NzbDrone/NzbDrone.exe -nobrowser -data=/mnt/dietpi_userdata/sonarr

[Install]
WantedBy=multi-user.target
Reload the service settings:

Code: Select all

systemctl daemon-reload
Restart the service:

Code: Select all

service sonarr restart
bookedirl
Posts: 29
Joined: Sat Oct 24, 2015 7:15 am

Re: Read/Write access denied with mounted drives?

Post by bookedirl »

Man, thanks so much for this answer this was an issue that I've been having for a couple years now and I could never figure it out. Finally saw this and it worked right away.

Merry Christmas!
MichaIng wrote: Sun Sep 16, 2018 2:49 pm @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.
ZeroZorro
Posts: 5
Joined: Wed Nov 13, 2019 3:47 pm

Re: Read/Write access denied with mounted drives?

Post by ZeroZorro »

Great!!!

Can't wait for the solution for the NFS mount also and finally be able to use my Synology NAS as a persistent NFS storage share for my RPI Docker Swarm !!

Thanks for all the efforts!!!
User avatar
Joulinar
Posts: 5096
Joined: Sat Nov 16, 2019 12:49 am

Re: Read/Write access denied with mounted drives?

Post by Joulinar »

Hi,

there is no problem to use your Synology as NFS Server together with DietPi. You can mount the NFS share using dietpi-drive_manager
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply