Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use NFS as db path for my MongoDB (which I read is not recommended, but a client demands it that way) and I'm having trouble separating the journal files.

How would I do that? I've tried setting the dbpath to /mnt/nfs and it works, but the journal directory is there as well...

Any hints?

share|improve this question
What's the exact error message? How do you determine that is doesn't work? Did you set the NFS options indicated in the mongodb documentation: bg, nolock, and noatime? – Dimitre Radoulov Jan 8 '14 at 10:05
There is no error message. Problem is that journal directory is on NFS server as well, and it shouldn't be. I want to leave journal directory on the local machine, as per documentation. – ivica Jan 8 '14 at 10:08
up vote 3 down vote accepted

You have to create a symbolic link that points to the new mountpoint:

If your server runs out of disk space for journal files, the server process will exit. By default, mongod creates journal files in a sub-directory of dbpath named journal. You may elect to put the journal files on another storage device using a filesystem mount or a symlink.


If you place the journal files on a separate storage device you will not be able to use a file system snapshot tool to capture a valid snapshot of your data files and journal files.

share|improve this answer
Thank you for answering my question. Let me recap: my dbpath is /mnt/nfs . So, I need to link /mnt/nfs/journal to /var/lib/mongo/journal ? – ivica Jan 8 '14 at 10:30
Yes, exactly (added for content min characters). – Dimitre Radoulov Jan 8 '14 at 10:36
Sorry for bothering you. I did this ln -s /mnt/nfs/journal /var/lib/mongo/journal and if I touch /var/lib/mongo/journal it shows on the NFS drive WHICH SHOULD'NT :( – ivica Jan 8 '14 at 11:13
What do you mean by "it shows on the NFS"? What's the output of cd /mnt/nfs/journal;df -h .? – Dimitre Radoulov Jan 8 '14 at 11:15
I meant that file gets created on the NFS drive (other computer). Here is the – ivica Jan 8 '14 at 11:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.