I am experiencing problem with setting up correct permissions for www-data user and group on external FAT drive. I want to this drive to be accessed by ownCloud and therefore I have set up following /etc/fstab in following way:

UUID=xxxx-xxx      /media/pi/EOS_DIGITAL   vfat    umask=777,uid=www-data,gid=www-data,utf8,nofail 0       0

After mounting and running sudo ls -la /media/pi/EOS_DIGITAL I receive following output:

total 100
drwxrwx---  4 www-data www-data 32768 Jan  1  1970 .
drwxr-x---+ 4 root     root      4096 Nov 18 21:56 ..
drwxrwx---  5 www-data www-data 32768 Jul 28 18:23 DCIM
drwxrwx---  2 www-data www-data 32768 Jul 28 18:23 MISC

However when trying to access this folder with www-data I am receiving Permission denied message. I am not able to setup ownCloud as well:

Can't create or write into the data directory /media/pi/EOS_DIGITAL

What am I missing here?

  • This is about Raspbian and as such off-topic here. – user589808 Nov 19 '16 at 16:19
  • @CelticWarrior please could you tell me how you know that? – Zanna Nov 19 '16 at 19:08
  • @Zanna Because of the other question: askubuntu.com/questions/851223/… . The user is already aware of the off-topic. – user589808 Nov 19 '16 at 19:15
  • 2
    @Zanna: I think we should keep it open. The situation would have been identical in Ubuntu (it's about POSIX access permissions after all) and it has a worthwhile accepted answer. As a rule of thumb we shouldn't close questions with good accepted answers unless they blatantly violate the rules (terdon told me that recently but I can't a reference to it atm). – David Foerster Nov 20 '16 at 11:26
  • @DavidFoerster oh hmm well I definitely agree with that, my general policy is to only VTC as dupe if I see the post has a valid accepted answer & otherwise leave open. I didn't notice in this case. Retracted – Zanna Nov 20 '16 at 11:29
drwxr-x---+ 4 root     root      4096 Nov 18 21:56 ..

These are the permissions of the /media/pi folder. As you can see the owner is the root user and other users cannot access the files and folders inside it.

You need to set the owner of that folder to www-data

chown www-data:www-data /media/pi
  • but .. shows the permissions for parent folder (/media/pi in this case) – Alexandr Zhurkov Nov 19 '16 at 13:41
  • You're right! Sorry, my bad! You need to chown the /media/pi folder and not /media/pi/EOS_DIGITAL – jsalatas Nov 19 '16 at 14:46
  • My answer is corrected now. – jsalatas Nov 19 '16 at 14:49
  • Great, that helped! Thanks for your time :) – Alexandr Zhurkov Nov 19 '16 at 15:30

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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