Linux noob here :-)

I've been struggling with this since days, and didn't come out with a solution yet. Basically what I am trying to achieve is the following:

I have a device which by default mounts (at boot with an fstab entry) at a certain mount point called DATA under /media/mynormaluser. I would like to have this listed as local device within Owncloud without the need to map it as external storage (being that this is a secondary disk where I store all my data) by enabling the "external storage" app as well as move the data directory out of where it resides right now. I've been looking at solutions like creating a symlink but Owncloud doesn't seem to handle it so I found the alternative solution using bind mounts. Issue is, Owncloud uses the apache user (which iswww-data) and of course that user doesn't have the appropriate permissions set on my secondary disk, and I don't want that user to be the owner. So investigating on how to create bind mounts I saw it is possible to set the mount permissions differently to what is set on the primary (not bind) mount. This way I should be able to access that folder without the need to change the owner of the directory/files (at least I hope so). I basically followed those 2 discussions here:

but that didn't work the way I was expecting. This is what I have done based on those 2 discussions:

  • created a folder within the owncloud user data directory
  • added this fstab entry:

    device mountpoint(the folder that I just created) none bind,www-data 0 0
  • saved the fstab
  • triggered a mount -a to reload the fstab entries The folder was correctly mounted but the permissions were still wrong, indeed I got the message "owncloud cannot write here" as soon as I opened that folder.

I have no idea on how to proceed further, for now I just came back to the original solution using the "external storage" option within Owncloud.

Thanks a lot everyone!

  • That should work. I mean, the group owner of that drive is the one which my user belongs to, so I should be able to add the apache user to that group.. – Vanni Apr 10 '15 at 12:16
  • And??? Did it work? – Fabby Apr 12 '15 at 14:45
  • took me a while to refresh that change (I didn't want to restart the machine, so I tried to reboot the apache service, unmount - mount the drive but that didn't seem to work), I guess that I restarted the machine some days ago and today I tried again and it works now! So I am just not sure if the restart fixed the issue, but in any case adding www-data to the group where my user belongs to did the trick! Thanks for the suggestion! – Vanni Apr 12 '15 at 14:54
  • the bad thing is that I am now getting the "Your storage is full, files can not be updated or synced anymore!" error... :( uff... – Vanni Apr 12 '15 at 15:00
  • Yes I think you can do it. – Vanni Apr 15 '15 at 9:18

One solution to this problem is to add the www-data user to the group which owns the file, then adjust the group permissions for the file using chmod , so that the group has write access.

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.