No permission to write

Hi, I am trying to sync a folder from my secondary drive with Nextcloud and I get the error:
'Warning: You have no permission to write to the selected folder!'
I am able to sync a folder on my system drive.
My account is admin, I can’t seem to find the problem.

Debian 9
Nextcloud 13.0.0

Any help appreciated thanks.!


But this folder exists on your PC?
How did you mount the secondary drive on you PC? Can you show us the folder permissions of /Nextcloud and /Nextcloud/Nextcloud_sdb?
You didn’t start the sync client with a user who has limited rights?

Yes the folder exist, it used to work but I modified something but I can’t find out what…
I used the command mount -t ext4 to mount the disk.
the correct path updated:

/linserv# ls -l
total 20
drwxrwxrwx 1 linserv linserv 16384 Feb 22 18:58 New Volume
drwxr-xr-x 4 www-data www-data 4096 Feb 23 00:23 Nextcloud

/Nextcloud# ls -l
drwxr-xr-x 2 root root 4096 Feb 23 00:00 Nextcloud_sdb
shouldn’t www-data have write access also?

/Nextcloud_sdb# ls -l
total 0

I use my admin account for the sync client.


And the admin account you use for the synch client is root?
Can you try with
chmod 777 Nextcloud_sdb

just to see if it makes a difference?
Can you run
lsattr /Nextcloud/

and post the output?

shouldn’t www-data have write access also?
This is not the machine were Nextcloud is running on, right? So the server is another, a different machine?

Problem solved using chmod 777 Nextcloud_sdb
Is there a way I can check If my NC admin account is part of root?
Is there documentation on how permissions work with NC? I can’t find any.

lsattr /Nextcloud/
lsattr: No such file or directory while trying to stat /Nextcloud/

It’s a secondary disk on the server mounted on /dev/sdb1

Thanks for all the help!


While I suggested to use chmod 777 on the folder, I don’t believe it is a good idea for the final solution.
It was only meant to find out, that it is only a permission issue.
As final solution however, it is better to give the folder the right owner ship and handle things with groups.

I’m not sure which user and group really needs access there and which user wants to synch his files. I hope you can figure it out yourself.
To your question however: to find out which groups your user belongs, simply run the following command as your NC admin user

We really need to make sure we talk about the correct instance here; server or client.

On the server:

  • the ownership of Nextcloud folder and NC data folder has to be for the web server user (www-data or http or apache depending on your system)
  • for better security every file should have permissions 0640
  • for better security every folder should have permissions 0750

On the client:

  • I’d say the folder which you want to synch will usually belong to your personal user who you log in with to use your computer
  • therefor the folder you want to synch will usually belong to that user (that user has the ownership)
  • the client will be started as that user and will therefor have access to the folder to synch

Maybe further explanation is needed, so that I can understand from what machine to machine you want to synchronize files.
Or somebody else understands that and can help here :slight_smile: