Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongodb server not starting up after changing dbpath

Tags:

mongodb

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

like image 323
Manish Avatar asked Oct 31 '22 03:10

Manish


1 Answers

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

like image 192
oori Avatar answered Nov 15 '22 07:11

oori