I've just been following Amazon's instructions for adding a new volume to create an XFS disk for MongoDB. As per these, my fstab line looks like:

UUID=....  /data    xfs     defaults,nofail     0       2

Are the defaults OK, or should I be settings something to optimize performance? MongoDB's production notes don't mention anything.

1 Answer 1


No, as far as I know. These "default" settings are just enough. However, I would not add nofail (do not report errors for this device if it does not exist), I want to see an error if MongoDB data directory don't mount.

..In the scenario where the node is part of replica set and it is restarted and the mongod process is starting automatically. Mongod cannot find any data files, so it goes to RECOVERY -state and starts initial sync, what will fill nodes root partition at a fast pace.

But, of course in the situation, where you don't have access to virtual machines console, you must put that nofail, so you don't end up in a situation where you cannot access your machine. You go around the problem by creating a subdirectory (f.ex. mongo) under that /data (/data/mongo) and pointing dbPath to that directory. No mount, no directory --> mongod don't start.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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