5
votes

I changed dbpath of my mongodb, and moved content of earlier dbpath folder to the new one. But the server is not starting up. Upon investigating mongodb logs, I found following exception:

016-05-23T10:50:51.697+0000 I STORAGE [initandlisten] exception in initAndListen std::exception: boost::filesystem::status: Permission denied: "/media/user/Shared/mongodb/storage.bson", terminating

I found a similar question here, but it did not help me fix the issue. Here is the current permissions of my dbpath folder and storage.bson file:

-rwxrwxrwx 1 mongodb mongodb         69    May 23 08:57 storage.bson*
drwxrwxrwx 3 mongodb mongodb         4096  May 23 09:04 mongodb/

I did try removing lock file (/var/lib/mongodb/mongod.lock) but it also did not help me.

BTW, I am using version v3.0.8 of MongoDB and starting it through sudo service mongodb start

1

1 Answers

2
votes

Had the same problem resolved by adding the executable permission to other users on the /home, and all the way down to the db path. for example:

chmod -R o+x /<home>

or more specific (notice the -R recursive flag) chmod o+x /<home> chmod -R o+x /<home>/mongodb