Recovering MondoDB from an unclean shutdown

If MongoDB is refusing to start up and you see this message:

**************
 old lock file: \data\db\mongod.lock.  probably means unclean shutdown,
 but there are no journal files to recover.
 this is likely human error or filesystem corruption.
 found 1 dbs.
 see: http://dochub.mongodb.org/core/repair for more information
 *************

… see the instructions pointed to by the suggested URL.

Try starting up with the –repair option. When it completes, restart the server process as normal.

If you have the ‘probably means unclean shutdown’ message, remove the mongod.lock file by hand and then restart with –repair

2 Replies to “Recovering MondoDB from an unclean shutdown”

  1. Please How do I remove the mongod.lock file I’ve searched but couldn’t find it. And I have followed all the instructions for unclean shut down but still getting same issues

    1. Does the error you are seeing tell you where the .lock file is located? e.g. in the error I was seeing, the error message told me it was located (on my Mac), at: datadbmongod.lock

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.