XFS or EXT4

Anteaus

Platinum Member
Oct 28, 2010
2,448
4
81
I'm going to beat the metaphorical dead horse. I realize that there are many of articles and threads out there dealing about XFS and EXT4 filesystems. For whatever reason, there seems to be little continuity in whats prefereable. I'm currently using EXT4 on my 4TB storage drives in my server. I'm not using raid nor any sort of drive pooling so the need to handle very large single volumes isn't there.

Would there be any tangeable benefit to moving to XFS at this point or should I stick with EXT4, or perhaps even regress to EXT3? I'm looking to opimize my server performance, with primary focus on survivability in an uncommanded shutdown situation.

I looked into ZFS as it is getting alot of positive attention; however, it isn't support out of the box with my distro due to license conflicts.

I realize there is no hard and fast rules here. That said, I would like to know if anyone has preferences and what they are based on.
 

lxskllr

No Lifer
Nov 30, 2004
59,143
9,584
126
My preference is EXT4 due to it being the defacto standard. btrfs looks like it has promise, but I don't think it's ready for production yet. I can't give a good weighing between XFS and EXT4, but I definitely wouldn't use EXT3 if you want good fault tolerance. EXT4 is an improvement over 3.
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
XFS is a fine OS, and well supported. It has a tendency to eat data, where EXT4 is less likely to, but that brings the system up faster. EXT4 v. XFS is practically an unanswerable issue, at least objectively, and without multiple file systems to work with on multiple computers.

XFS is really not at all in competition with ZFS, though. XFS used to be slower in some operations, like small file work, and mass deletions, leading people to either stick to EXT3 (and then 4), or use JFS. Today, it's quite fast all-around.

JFS is also a good FS, but like XFS, will happily destroy questionable data to get the system back up and running. But, JFS' long-term problem has been poor fsck support. You can make your own with IBM's source, and have a good one, or just use another FS. JFS should definitely be deprecated, now that EXT4 is quite reliable in COTS PCs.

BTRFS is the new hotness, and is ZFS', "competition." If you were considering ZFS, look at BTRFS. It's more flexible in some ways, less in others, and not too well documented, but it supports compression and snapshots, and has checksumming on everything.
 
Last edited:

Anteaus

Platinum Member
Oct 28, 2010
2,448
4
81
Thanks for the information. I think I'll just stick to EXT4, since it seems like the best overall solution for the time being.

For a side question, is there any downside to using sync as an fstab mount option for a hdd other than maybe a write speed penalty? By default it is async, which from what I understand means it buffers to memory before writing in order to maximize write speeds. I'm thinking this will help make the file system less likely to get corrupted if power is lost if there are no files waiting in memory to be written. Perhaps I'm looking at it wrong though.
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
It will create more HDD activity, slow down reads and writes when there is HDD activity, and provide no benefits, for an internal drive. It could even make things worse, by increasing the chances that the drive will be writing while it is unexpectedly powered down.

It's normally used for removable media, since someone might eject it without unmounting it, mere seconds after userspace got done with write requests, but before those requests are fully serviced by potentially-delayed writes. With EXT4, using default settings, delayed writes should not create any significant inconsistencies, and should create no unrecoverable ones (that is, if power drops during a no-write wait period).

Using 'noatime' will do more good than 'sync'.
 

ashetos

Senior member
Jul 23, 2013
254
14
76
XFS is by far the most reliable and well tested for failure scenarios and huge data-sets (developed/maintained/backported by RedHat).

EXT4 should be the fastest for most workloads.

I don't quite trust BTRFS enough yet.

My 2 cents.
 

mv2devnull

Golden Member
Apr 13, 2010
1,519
154
106
XFS is a fine OS, and well supported. It has a tendency to eat data, where EXT4 is less likely to, but that brings the system up faster.
Wasn't it so that the default mode of ext4 is conservative, but it has a more aggressive mode too -- with XFS-like behaviour?
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
Wasn't it so that the default mode of ext4 is conservative, but it has a more aggressive mode too -- with XFS-like behaviour?
The default should be data=ordered (configurable, but rarely different), which writes data then metadata. The conservative option is data=journal, writing twice. The aggressive option, not default, is data=writeback, which does not preserve ordering.

I was meaning fsck/recovery behavior, though. XFS will chew files right up to get mountable again, while EXT4 will typically ask you what to do, if it can't safely remove entries (like EXT3, but with EXT3, such recovery problems were much more common). Without physical machine access, the former would be preferred. Even if you can get to the console over the network, do you want to deal with the fsck, or just do a sync/copy from backups?
 
Last edited: