Can I delete old journaling files?

1,396 views
Skip to first unread message

Justin Meltzer

unread,
Nov 2, 2012, 3:15:36 AM11/2/12
to mongod...@googlegroups.com
First off, I'm fairly new to mongodb and journaling so I do not fully understand exactly how journaling works.

I'm trying to change the dbpath after having already used a previously different dbpath. I followed the ec2 quickstart guide here: http://www.mongodb.org/display/DOCS/Amazon+EC2+Quickstart#AmazonEC2Quickstart-Prerequisites and am now copying over my data to a filesystem that is backed by RAID 10. Copying over my regular database files worked fine, but the prealloc.X files in the journal directory are completely filling up the /journal partition. Is it ok to delete these files, and will journaling still work if I do?

Justin Meltzer

unread,
Nov 2, 2012, 3:19:39 AM11/2/12
to mongod...@googlegroups.com
Also I did not have any sort of database crash. I cleanly shutdown my database.

Plus I'd be curious to learn what these prealloc.X files are for.

Louisa Berger

unread,
Nov 2, 2012, 11:26:46 AM11/2/12
to mongod...@googlegroups.com
Hi Justin,

So the prealloc files are preallocated journal files. There are also in use journal files ( they look like j._X ). Mongod creates these so that  when the current journal file runs out of space, the next file is already allocated. This can be aster than doing on-demand allocation. You can read more about it here.

These files don't contain any data, so it's safe to remove them. However, if you restart mongod with journaling set to 'on', it will recreate them if they are missing. 
Reply all
Reply to author
Forward
0 new messages