Background
I have a BananaPi with Bananian, Apache2 and OwnCloud. Plugged into the Banana Pi is a NTFS-formatted HDD that gets mounted via ntfs-3g. I created five users on the system and there is a .NTFS-3G/UserMapping file inside the base-directory of the mounted partition, resulting in a UID/GID/SID mapping of the users and in automatically setting the permissions and acl options when the partition gets mounted. (www-data is not included in the UserMapping-file.) This partition contains a directory shares for Samba-shares and a directory owncloud/data. The owner of the whole owncloud-tree is root:root and permissions are 777.
Problem
In order for apache to access the data and owncloud to work, the owncloud/data directory has to belong to www-data:www-data. But if I try this:
chown -R www-data:www-data /media/hdd/owncloud/data the ownership gets set to root:root, whatever owner the files and folders had before. This also happens for a single file:
chown www-data:www-data /media/hdd/owncloud/data/owncloud.log and for every other place on the HDD:
chown -R www-data:www-data /media/hdd/shares/maximilian But if I set the ownership to an arbitrary user, for example:
chown -R maximilian:maximilian /media/hdd/owncloud/data it works perfectly fine!
Why can't I set the ownership to www-data then?
permissionsoracloption while mounting instead of user mappings since it will make things simpler.::S-1-5-21-1833069642-4243175381-1340018762-10000Now the chown works fine. By the way, OwnCloud still showed me "Cannot create "data" directory". The reason was missing execute permissions for others on the path to the data folder as pointed out here.permissionsalso worked for the chown. Initially, my intention for using the UserMapping-file was to get data uploaded from Win machines to the shares folder via SMB to be owned by the acting user in Win instead of always root. It didn't work out, though. Anyway, I just wanted to know the reason for my problem at least. Now that it works, I can save myself the effort to add-o permissionsto themount-command every time. :-)