Mount network drive - Folder is not writable by user

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Gogan
Posts: 5
Joined: Mon Mar 02, 2020 6:55 pm

Mount network drive - Folder is not writable by user

Post by Gogan »

Hello

Been using DietPi on RPi4 for over an year with Sonarr, Radarr, Lidarr, Deluge and a directly connected USB drive, all great!

I'm having some problems trying to use an old Seagate Central NAS. I add the drive through DietPi-Drive Manager and the mount its visible and accessible by (for ex.) Sonarr, when I try to select it I get the error "Folder is not writable by user sonarr" (same for Radarr and Lidarr) but a blank sonarr_write_test.txt is created

Tried with a different NAS (WD My Clould EX2 Ultra) and everything works fine

Noticed the Seagate drive uses CIFS 1.0 and the WD CIFS 3.1.1, dont know if might be it and if/how get around it

Code: Select all

//192.168.X.XXX/XXX /mnt/Seagate cifs username=XXX,password=XXX,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=1.0,_netdev,nofail,noauto,x-systemd.automou$
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Mount network drive - Folder is not writable by user

Post by Joulinar »

Hi,

you could change mount options in /etc/fstab to user sonarr and / or file permission to 777. The following part to be changed:

Code: Select all

uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770
btw: if possible don't use SMBv1 anymore 8)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Gogan
Posts: 5
Joined: Mon Mar 02, 2020 6:55 pm

Re: Mount network drive - Folder is not writable by user

Post by Gogan »

Tried this variants, none worked:

Code: Select all

uid=dietpi,gid=dietpi,file_mode=777,dir_mode=777
uid=sonarr,gid=dietpi,file_mode=777,dir_mode=777
uid=sonarr,gid=sonarr,file_mode=777,dir_mode=777
Joulinar wrote: Mon Mar 02, 2020 8:37 pm btw: if possible don't use SMBv1 anymore 8)
yeah, i know... that's why i'm "retiring" this NAS to an "isolated" group.
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Mount network drive - Folder is not writable by user

Post by Joulinar »

stupid question but did you rebooted your DietPi device after changing the mount option?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Gogan
Posts: 5
Joined: Mon Mar 02, 2020 6:55 pm

Re: Mount network drive - Folder is not writable by user

Post by Gogan »

well... i would swear i did...

Code: Select all

uid=sonarr,gid=dietpi,file_mode=777,dir_mode=777
Did the trick with Sonarr

How can I make the same to Radarr and Lidarr?
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Mount network drive - Folder is not writable by user

Post by Joulinar »

you mounted your share with permission for user sonarr and group dietpi now

Code: Select all

uid=sonarr,gid=dietpi
however you mounted the share with full r/w permission as well

Code: Select all

file_mode=777,dir_mode=777
so it should work for everybody.

Anyway, you could add all users for Sonarr, Radarr, Lidarr and Deluge to dietpi group.

Excample for Sonarr user

Code: Select all

usermod -a -G dietpi sonarr
Just do it with all the other users as well
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Gogan
Posts: 5
Joined: Mon Mar 02, 2020 6:55 pm

Re: Mount network drive - Folder is not writable by user

Post by Gogan »

Code: Select all

usermod -a -G dietpi sonarr
usermod -a -G dietpi radarr
Doesn't seem to work (I did reboot)
uid=radarr,gid=dietpi,file_mode=777,dir_mode=777
Replacing user with radarr makes radarr works but sonarr doesn't work anymore

Can I check if the users are effectively added to dietpi group?
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Mount network drive - Folder is not writable by user

Post by Joulinar »

you could try to display all groups the user belongs to

Code: Select all

groups <username>
not sure if this will have any side effects but you could try to change primary group as well

Code: Select all

usermod -g groupname username
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Gogan
Posts: 5
Joined: Mon Mar 02, 2020 6:55 pm

Re: Mount network drive - Folder is not writable by user

Post by Gogan »

sonarr : sonarr dietpi media
radarr : radarr dietpi media



No good. Any other idea before I pickup the screwdriver?
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Mount network drive - Folder is not writable by user

Post by Joulinar »

can you try to make dietpi as primary group for user sonarr and radarr

Code: Select all

usermod -g dietpi username
dietpi should now appear on first place if you check the user again

if this was working, change the mount back to uid=dietpi,gid=dietpi and reboot you system
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply