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
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 is
www-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:
- How to unmount after using mount --bind option?
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 -ato 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!