Hi,
You are correct that db.fsyncLock()
could be used to lock the database against writes for backup purposes. This is mentioned in Back Up with cp or rsync
However, there are a couple things that may explain what you observed:
The db.fsyncLock()
command only locks data files. The diagnostic.data
directory contains internal statistics collected by the mongod
process for troubleshooting purposes, and doesn’t contain any data.
The cmin
parameter is in minutes. Have you waited for at least a minute after issuing the db.fsyncLock()
command? From my cursory test, after a minute, the data directory only shows changes in the diagnostic.data
directory (which is expected, since the mongod
process is still running despite the data files being locked).
Best regards,
Kevin