I've got 16 nodes of elasticsearch (RHEL 7) - 18TB each, every node has a ext4 filesystem. For better efficency I need to change to XFS filesystem. Is there any tool / way which help me change filesystem without losing data? Or have I to do full backup of each node, which will be difficult because of large size of data files?
-
1You should have backups anyway.... and migration to new hardware, file stores, etc. is a great way to test your backup and restore methods and make sure you are saving what you think you are saving. – ivanivan Jul 29 '19 at 22:45
2 Answers
The extensible filesystem family (ext) has provided one way in place upgrades (ext2 to ext3 and ext3 to ext4); but this is only possible because the filesystem was specifically designed to be able to do this. There may be other filesystem families that are designed with a similar feature. In the case of a within family filesystem upgrade the risk of failure is relatively low. In any case, it would be wise to backup data before a filesystem upgrade in case something goes wrong.
A tool has been created to convert between some types of filesystems on Linux. In theory fstransform can be made to work with any Linux filesystem that supports sparse files (both ext4 and XFS are supported). It does require some free space (more than 10% free is recommended to transform to XFS) and the filesystem must be taken offline to transform.
- 220
- 1
- 6
robartsd is 101% correct when they advise you to backup your data; I think multiple backups, each verified, is called for before you convert from ext4 to XFS. Yes, it's 288 TB, but only you know what would happen if you lost your data.
One suggestion is to run mkfs.xfs /dev/xvdf1 -f , a package almost certainly installed in your RHEL now, after reviewing the source of the suggestion. Another uses fstransform more and more which is installed by sudo dnf install fstransform (source).
- 3,696
- 4
- 22
- 39