2

I auto mount (on boot/startup) an external (USB) HD on my Ubuntu Server. But, my webserver must see, and have access to the filesystem on this HD. My System is 3.16.0-53-generic #72~14.04.1-Ubuntu SMP Fri Nov 6 18:17:23 UTC 2015 x86_64 >x86_64 x86_64 GNU/Linux

At the moment I mount the HD with these settings:

/dev/sdb1   /media/MOUNTPOINT   ext4    defaults    0   0

I need rights for user "www-data". But, if I do this after automount, a error message comes up ...

sudo -u www-data chown -R www-data:www-data /media/MOUNTPOINT chown: der Eigentümer von »/media/MOUNTPOINT“ wird geändert: Vorgang nicht zulässig

translation: "Operation not allowed."

How can I mount the whole HD for user "www-data"?

  • Practical solution #1: Do not change the mountpoint put put all data one level deeper. – Hennes Nov 18 '15 at 13:17
  • You can write LANG=C before a command to get English output, e.g. for posting it here. Example: LANG=C sudo -u www-data chown -R www-data:www-data /media/MOUNTPOINT. Or you can write LANG=C as single command to set the terminal session language to English. It will go back to your default when you close the terminal window and open a new one. – Byte Commander Nov 18 '15 at 15:52
2

You have to run chown as root user, as www-data is not allowed to change the owner of the files:

sudo chown -R www-data:www-data /media/MOUNTPOINT

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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