What is the main difference between Ext4 and XFS?
At a glance, its main features include: Support for large file sizes - The Ext4 supports a single file size of up to 16 TiB ( Tebibytes ) whereas XFS supports a max file size of up to 8 exbibytes. Delay allocation based on extent for faster file allocations.
In general, Ext3 or Ext4 is better if an application uses a single read/write thread and small files, while XFS shines when an application uses multiple read/write threads and bigger files.
In terms of XFS vs Ext4, XFS is superior to Ext4 in the following aspects: 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.
XFS provides journaling for file system metadata, where file system updates are first written to a serial journal before the actual disk blocks are updated. The journal is a circular buffer of disk blocks that is not read in normal file system operation.
Use ext2 or non-journaled ext4 for boot. You should use ext4 for your main partition. It provides high-performance, is quite stable, and is very resilient in the face of random corruption due to its use of a journal. You can also use XFS which is a very well-written, fast, and mature general-purpose filesystem.
At a glance, its main features include: Support for large file sizes - The Ext4 supports a single file size of up to 16 TiB ( Tebibytes ) whereas XFS supports a max file size of up to 8 exbibytes. Delay allocation based on extent for faster file allocations.
XFS is a high-performance 64-bit open source filesystem merged into the Linux kernel. XFS is supported by most Linux distributions, and is even used as the default filesystem for some Linux distributions. XFS supports large files and large file systems.
- Using df Command. ...
- Using fsck Command. ...
- Using lsblk Command. ...
- Using mount Command. ...
- Using blkid Command. ...
- Using file Command. ...
- Using fstab File.
XFS supports metadata journaling, which facilitates quicker crash recovery. The XFS file system can be defragmented and enlarged while mounted and active. In addition, Red Hat Enterprise Linux 7 supports backup and restore utilities specific to XFS.
XFS is a high-performing, journaling Linux file system. Originally developed by Silicon Graphics, Inc. (SGI), it became part of the mainline Linux Kernel with version 2.4. With the release of Oracle Linux 6.4, customers with Premier Support subscriptions are entitled to XFS support, at no additional charge.
Is XFS stable?
The XFS v5 on-disk format is considered stable for production workloads starting in Linux Kernel 3.15.
Windows doesn't support XFS file system, so if you connect a XFS drive to a Windows computer, it can not be recognized by the system.

Filesystem-level Compression: The XFS filesystem does not include built-in filesystem-level compression support. The Btrfs filesystem includes built-in filesystem-level compression support. This feature allows you to compress a single directory, a single file, or the entire filesystem to save disk space.
The safest size is twice the amount of physical RAM. The /boot partition can be any size, but is recommended to be anywhere between 17MB and 25MB and no larger than 50MB because it only contains the Linux kernel(s) and their boot time files.
- Make a backup.
- unmount the disk/partition/volume.
- format the disk/partition/volume with mkfs.xfs.
- restore the data from backup.
The /boot and / (root) partition in Red Hat Enterprise Linux 6.9 can only use the ext2, ext3, and ext4 (recommended) file systems. You cannot use any other file system for this partition, such as Btrfs, XFS, or VFAT.
Metadata operations in XFS have historically been slower than with other file systems, resulting in, for example, poor performance with operations such as deletions of large numbers of files.
Unfortunately, XFS is not capable of being shrunk at the moment (and for the foreseeable future) so what I needed to do was to: add a new virtual device correctly using VIRTIO and stored in the right storage area of the virtualization host server. migrate all the filesystems to the new virtual device.
XFS is the best choice here since external drives are CPU intensive and highly dependent on the USB bus.
XFS supports a maximum file system size of 500 TB and a maximum file size of 16 TB. You can create an XFS file system on a regular disk partition and on a logical volume.
Is XFS copy on write?
Copy on write is used when necessary to keep file contents intact, but XFS otherwise continues to use direct overwrites to keep metadata overhead low. The filesystem automatically creates speculative preallocations when copy on write is in use to combat fragmentation.
- Debian, Ubuntu or Linux Mint: $ sudo apt-get install xfsprogs.
- Fedora, CentOS or RHEL: $ sudo yum install xfsprogs.
- Arch Linux: $ sudo pacman -S xfsprogs. Create an XFS-Formatted Disk Partition.
The ext4 or fourth extended filesystem is a widely-used journaling file system for Linux. It was designed as a progressive revision of the ext3 file system and overcomes a number of limitations in ext3.
There is currently no command to shrink an XFS file system. You can use the xfs_growfs command to increase the size of a mounted XFS file system if there is space on the underlying devices to accommodate the change. The command does not have any effect on the layout or size of the underlying devices.
- Step:1 Create a partition using fdisk.
- Step:2 Create LVM components : pvcreate, vgcreate and lvcreate.
- Step:3 Create XFS file system on lvm parition “/dev/vg_xfs/xfs_db”
- Step:4 Mount the xfs file system.
- Step:5 Extend the size of xfs file system.
You should remember that both XFS and JFS were both originally designed for servers, so both are built for that kind of work load, though each has its own strengths and weaknesses. They are both very mature and very stable and proven reliable.
ext4 uses checksums in the journal to improve reliability, since the journal is one of the most used files of the disk. This feature has a side benefit: it can safely avoid a disk I/O wait during journaling, improving performance slightly.
So CoW in XFS is data-only. Data-only CoW limits the functionality that XFS can provide; features like deduplication and file cloning are possible, but others are not.
XFS is a high-performing, journaling Linux file system. Originally developed by Silicon Graphics, Inc. (SGI), it became part of the mainline Linux Kernel with version 2.4. With the release of Oracle Linux 6.4, customers with Premier Support subscriptions are entitled to XFS support, at no additional charge.
- Make a backup.
- unmount the disk/partition/volume.
- format the disk/partition/volume with mkfs.xfs.
- restore the data from backup.
What is Ext4 used for?
ext4 enables write barriers by default. It ensures that file system metadata is correctly written and ordered on disk, even when write caches lose power. This goes with a performance cost especially for applications that use fsync heavily or create and delete many small files.
Windows doesn't support XFS file system, so if you connect a XFS drive to a Windows computer, it can not be recognized by the system.