I managed to run ownCloud on my RaspberryPi 2 on Raspbian. Now I am trying to move the data directory to my NAS.

I already shared a folder on my NAS with CIFS and mounted the folder. This allows me to access the shared directory via the command line and manipulate entries. So that works. However, when opening ownCloud in my browser, I get the following error message:

Data directory (/home/pi/Cloud/storage) is readable by other users

Please change the permissions to 0770 so that the directory cannot be listed by other users.

So I tried to adjust the permissions in the /etc/fstab file, where I mounted the shared directory. This also worked out, but changes the owner from www-data to pi. With the result that ownCloud does not run at all, since the data directory has to be owned by www-data.

I mounted the shared folder by adding the following line to the /etc/fstab file:

//<NAS-IP>/<sharedFolder> /home/pi/Cloud/storage cifs username=<my username>,password=<my password>,uid=www-data,gid=www-data,dir_mode=770,file_mode=770,umask=0007 0 0

Which results in these permissions:

drwxr-xr-x 2 pi    pi    4096 Sep  2  23:15 storage

So the problem is that the data directory can be read by all users, but when I restrict the permissions, it is not owned by www-data anymore.

Does anyone have an idea how to fix this? It seems that I am so close to have ownCloud running, but I can't figure out this last step.

2 Answers 2


So, it turned out that the permissions on the NAS were not set correctly. This answer pointed me in the right direction.

The problem was, that I created the shared folder on the NAS as admin user via the GUI. I solved the problem by deleting that folder and recreating it via SSH as the user that I also specified in the /etc/fstab file.

I also adjusted my /etc/fstab file to look like this:

//<NAS-IP>/<sharedFolder> /home/pi/Cloud/storage cifs username=<my username>,password=<my password>,uid=www-data,gid=www-data 0 0

After that I still received an error message about a missing .ocdata file which I solved by simply creating an empty file with that name.


For the next person who runs into this issue like I did. umask, fmask and dmask did not work for me. I'm running Ubuntu 16.04. I had to add the dir_mode=0770 option to my fstab. I am using a windows share from a 2012 server as my base storage. I was receiving the same message

"Data directory (/home/pi/Cloud/storage) is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed 
by other users."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.