we faced this issue multiple times. we have mongodb community 6.0.20. when our server run out of space mongodb stops. this is ok. when we made space and restart mongodb. mongo is starting correctly but all data on the mongodb is corrupted and lost.
when we use mongosh command we get error like below
Current Mongosh Log ID: 67c6ae4a80b60365f9e43268
Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.3.9
MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017
we tried
sudo rm -rf /tmp/mongodb-27017.sock
sudo rm /var/lib/mongodb/mongod.lock
sudo mongod --dbpath /var/lib/mongodb --repair
all these, no luck. it wont work and we lost all data. and we had to reinstall our mongodb to fix this. luckily all these issue happened on development server. we are worried how to recover if this happened on our production server. please help