How do I successfully switch to XFS filesystem without corrupting any data?

My MongoDB has recently been using lots of CPU on IO Wait. I believe by switching to XFS filesystem it should stop these issues. How can I successfully do this without corrupting any of my current data? I am on Ubuntu 18.04. My disk is currently ext4.

First, you

https://docs.mongodb.com/database-tools/mongodump

and then you

https://docs.mongodb.com/database-tools/mongorestore

1 Like

If you have enough space elsewhere you can shutdown mongod and move all the files in the data directory out of the way. And move them back when after reformatting.

3 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.