XFS vs Ext4

Ext4 file system is the successor to Ext3, and the mainstream file system under Linux. Through many years of development, it is one of the most stable file systems. However, to be honest, it’s not the best Linux file system comparing to other Linux file systems.

In terms of XFS vs Ext4, XFS is superior to Ext4 in the following aspects:

  1. Larger Partition Size and File Size: Ext4 supports partition size up to 1 EiB and file size up to 16 TiB, while XFS supports partition size and file size up to 8 EiB. Please note that XFS is a 64-bit file system. When the host operating system is 32-bit, XFS only supports partition size and file size up to 16 TiB.
  2. Dynamically Allocated Inodes: XFS uses this technology. Inodes save the attributes and location of the data. It is used to index the file. However, when the inodes are used up, new files cannot be created, even if the hard disk is not full. Dynamics allocated inodes technology removes the limit to the number of inodes and users can make full use of disk space.
  3. More Xattr (Extended Attributes) Space: Ext4 limits the length of xattr not to exceed one block (usually 4K), while XFS can reach 64K. Extended file attributes are file system features that enable users to associate computer files with metadata not interpreted by the filesystem.
  4. Allocation Groups: XFS file systems are internally partitioned into allocation groups to manage inodes and free space separately, providing scalability and parallelism, so multiple threads and processes can perform I/O operations on the same file system simultaneously. This architecture helps to optimize parallel I/O performance on systems with multiple processors and/or cores.
  5. In-Built Dump and Restore Tool: XFS has xfsdump and xfsrestore utilities, which can back up and restore contents.

Of course, comparing Ext4, XFS also has some disadvantages, such as:

  1. XFS doesn’t support journal checksum that is used to check the correctness of the data.
  2. XFS cannot disable journaling. The drawback is that flash disk lifetime will be reduced.
  3. Metadata operations in XFS were slower. Therefore, deletions of large numbers of files will cause slower performance.
  4. The volume of the XFS file system cannot be directly shrunk. It can only be shrunk indirectly through “Backup > Refill > Restore”.