I'm trying to free up some space on an Ubuntu server running Mongo. I've attached a new, empty 8GB volume, and have the room to move stuff around.
I have several large (1GB) files in /var/lib/mongodb/journal/prealloc, is it safe to delete these or move them? If I can move them--can anyone give me a pointer on how to do this for Mongo?
So in theory, the prealloc
files are preallocated journal files. This is opposed to in use journal files which have the format j._X
, where X
is a digit.
The goal here is to have "the next" file already allocated when the last file runs out of space. Pre-allocation is often much faster than on-demand allocation.
is it safe to delete these or move them?
The answer you seek is in the documentation here. The docs there seem to provide the key answer to your question:
prealloc files do not contain data, but are rather simply preallocated files that are ready to use that are truly preallocated by the file system (i.e. they are not "sparse"). It is thus safe to remove them, but if you restart mongod with journaling, it will create them again if they are missing.*
Add "smallfiles=true" in the MongoDB configuration file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With