Hello,
I have MongoDB running on Ubuntu 22.04 and have my drive formatted as XFS. Some time in the past few days my 512GB drive was suddenly full because of the /var/log/mongodb log file. Now MongoDB won’t start.
I’ve read about enabling log rotation, but I cannot start MongoDB to enable this.
I have a lot of data in MongoDB that I have not backed up in a few weeks so really want to be careful with any steps I take.
That’s what I was wondering. But I had read that removing the log file could result in data loss or problems with the database. Do you think that is a real concern?
truncate -s0 /var/log/mongodb/mongod.log this will keep everything about the file the same except its contents.
If I ever come accross asituation like this I gzip the offending file in place and pkill -USR1 -x mongod as the mongod is not running in your installation just start mongod as @Kobe_W has suggested.