I am using MongoDB 3.4 (with WiredTiger) with several replica sets and it has been great so far.

I want to back up my data using snapshots as per the MongoDB recommendation for production backups.

I am also using XFS, as per the MongoDB warning in logs and my question "Is XFS still the best choice for mongodb?".

I moved my disk to LVM (using rsync to transfer all data to the new volume) and I allocated 100% of the VG storage to MongoDB (i.e. this disk will be used exclusively for MongoDB).

As a result I cannot take snapshots because there is no space in the VG, and XFS cannot be shrunk. Furthermore, if any zealous sysadmin runs resize on that disk, I will never be able to take snapshots again.

Is there a good solution to this problem?

  • You can always add "little bit more" storage to that LVM (VG) so snapshots can be taken... Of course, as long as nobody (sysadmin) make decision to use that space... ;-) Other choice is moving data away, re-create that LV (and this time little bit smaller) and copy data back. To answer that other question, is XFS best choice? It depends. Normally EXT4 works well with mongodb because there is no extreme high load for storage.
    – JJussi
    Nov 24, 2017 at 7:26
  • If your machine (and storage) is at virtual environment, there is usually "snapshot at storage level" possibility. Your provider's storage administrator can do that.
    – JJussi
    Nov 24, 2017 at 7:31
  • Has anyone tried this as a solution? (stackoverflow.com/questions/28942795/…)
    – mils
    Nov 27, 2017 at 2:54
  • 1
    I don't believe there is currently a non-destructive way to shrink XFS volumes in place, but based on your previous questions you have a sharded deployment with replica sets for shards. With a replica set you can do a rolling configuration change and re-sync (see Your Ultimate Guide to Rolling Upgrades). Manually backing up a sharded cluster requires some scripted coordination between various processes; for any significant production deployment I would consider a continuous backup tool like MongoDB Cloud/Ops Manager.
    – Stennie
    Nov 28, 2017 at 5:58


Your Answer

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

Browse other questions tagged or ask your own question.