I'm using Ubuntu 14.04. I'm trying to move my mongodb database files to another partition, which is mounted at boot at /media/my_username/files
.
I'm trying to use the solution mentioned in this answer.
I followed the instructions here, and successfully mounted the partition at boot time with:
udisksctl mount --block-device /dev/disk/by-uuid/the_partiotion_uuid
However, the user that I used to run mongod
, which is mongodb, have no access to the partition. When I run:
sudo -u mongodb -s cd /media/my_username/files
The result shows that user mongodb has no permission to access the directory. And through some searching and trying, it seems that chown
is not functional in a mounted partition, the permission is set when the partition is mounted.
How do I solve this?
THX