1

this is my mongod.lock:

-rw-r--r-- 1 mongodb mongodb    0 Dec  3 17:09 mongod.lock

hence this solution doesn't apply: https://dba.stackexchange.com/a/183018

this is how I start mongodb:

sudo systemctl start mongodb

and this is the output in mongod.log:

2019-12-03T17:12:01.676+0100 I  STORAGE  [initandlisten] exception in initAndListen: Location28596: Unable to determine status of lock file in the data directory /run/media/minze/Games/mongodb: boost::filesystem::status: Permission denied: "/run/media/minze/ssd/mongodb/mongod.lock", terminating

thanks in advance. I really don't see how mongodb would not be permitted to access a file owned by mongodb

New contributor
Tuaafooo is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • it works when the path is not /run/media/minze/ssd/mongodb/ but /var/lib/mongodb. Even when the directory in /run is copied by using cp -a so that all permissions remain the same. Why is that – Tuaafooo Dec 3 at 16:45
1

It works after I did:

sudo chmod +r /run/media/minze/ssd
sudo chmod +x /run/media/minze/ssd

I don't understand why.

mongodb.lock is located in /run/media/minze/ssd/mongodb/mongodb.lock

ls -lha gives me:

drwxr-xr-x 8 minze   minze   4.0K Dec  3 17:40 .
drwxr-xr-x 3 root    root      60 Dec  3 10:49 ..
drwx------ 2 root    root     16K Oct 15 20:24 lost+found
drwx------ 4 mongodb mongodb 4.0K Dec  3 17:54 mongodb

now

New contributor
Tuaafooo is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Tuaafooo is a new contributor. Be nice, and check out our Code of Conduct.

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.