Is there any correct way to convert file system from ext4 to xfs in centos? [closed]

Posted on

Question :

I have deployed MongoDB Sharding Cluster(os-centos) on Azure with 2 disks each VM. But default file system is ext4 and I want xfs file system because of performance. I want to convert that file system.

Is there any way of converting file system without any configuration changes in mongo?

I tried below steps:

  1. detach disk
  2. unmount dir
  3. attach disk
  4. create partition with xfs file system
  5. changes on fstab file
  6. mount dir

Answer :

  1. create partition where enough space, format it to xfs
  2. mount that partition to some directory
  3. stop mongod process
  4. rsync -aP src dst files from original mongod dbpath to this xfs mount
  5. unmount original dbpath partition mount AND this xfs partition
  6. mount xfs partition to path where mongod dbpath points
  7. start mongod process

So, basically when mongod process is stopped, copy all dbpath files to new location/partition and then point mongod process to use that location…

Leave a Reply

Your email address will not be published. Required fields are marked *