.ocdata problem

Hi, i’ve done a fresh install of nextcloud on my raspberry pi4.
After initial configuration i moved the data folder into external hdd.
After that i moved the folder i got this error:

The data folder is not valid to ensure there is a “.ocdata” file in the root of the data folder. Failed to create folder “data” This can normally be corrected by the web server having write access to the root folder. See https://docs.nextcloud.com/server/20/go.php?to=admin-dir_permissions

Then i checked the data folder permissions and in fact my main folder of nextcloud i can create and modify files, but in the data folder i can’t do nothing, the permissions seems correct:

sudo chown -R www-data:www-data /media/pi/ext/next

But if i check the /media/pi/ext/next/data i can’t do nothing inside it.

What can i try to do?

Thanks in advance

@Lyca_Gif can you done this command before your data directory : ls -l and send the result please.

Sorry for late reply:

pi@raspberrypi:~ $ ls -l /media/pi/ext/next
total 4
drwxrwxrwx 5 www-data www-data 4096 feb 17 10:05 data

I granted alla the access at /next and /next/data, but seems that it can’t write… and the .ocdata is in the /data folder.

Thanks in advance

@Lyca_Gif check if www-data have a read access to directory parent of your data directory

“Chiunque” means Everyone.

@Lyca_Gif same permissions for /media and /media/pi ?
the www-data user doesn’t need to be the owner of the other directories than /next and /next/data but just needs to have read access to them.

1 Like

The problem was what you said; i thought that wasn’t it needed grant access from the parent directory ;/ , i’m neonew in linux.
Thanks a lot for helping me, hope to see you again around ^^.
Have a nice day!

1 Like