if following error appear when try to start mongo in Linux
here is the solution:
Open Terminal and type following command
First Stop service
sudo service mongodb stop
Then remove the Mongo log file with following
sudo rm /var/lib/mongodb/mongod.lock
then change the permission of the Mongo Library and give full control to mongodb
sudo chown -R mongodb:mongodb /var/lib/mongodb/
Finally start Mongo service
sudo service mongodb start
- go to services.msc stop MongoDB service.
- then go to your data directory of Mongodb
- there is one “.lock” file, delete it.
- start MongoDB service