Linux – It is XFS reliable? In case of a power gone off is xfs riskier that ext3 in data corruption/safey

data integrityfilesystemslinuxxfs

I have been having some electrical issues,mostly power going out suddenly for a few months,and although ups solve the thing mostly.

But still i am worried about filesystem corruption,and data lost.

It is xfs worse than ext3 or less reliable when the computer goes off,or crashes or other filesystem issues?

Having a ups and a good backup strategy (i have a 1,5 tb disk that i want to use to backup all the critical data) is enough ,and i shouldn't be worried ?

I have been reading that xfs zero out data (although i think this has been solved) when the power goes off ,and things like that XFS is not safe against data corruption.

Enabling write barriers and tweaking xfs correctly, and having a ups and backups , could be xfs as reliable as ext3, or at least acceptable enough?

If i use xfs for / and /home to have more performance (with large files mostly), I will risk more my data,than using xfs?

Best Answer

My personal experience with XFS has been that the fsck for it is not as good as for ext3. We ran our mirror server on XFS, with around 3TB of space for linux distros and the like which we mirror. At one point it had some issue (we didn't have a power failure, IIRC it just started reporting errors). So on a reboot it wanted to do an fsck. However, the fsck took more RAM than the 2GB we had on the system, so it started swapping. After 3 days it ran out of memory. I maxed out the box to 3GB and it was then able to complete the fsck fairly quickly. I know 3GB isn't much ram these days, but at the time that was a pretty sizable box.

I also tried XFS on my laptop for a while. This is more closely like your "power failure" situation, because I was having problems with my laptop locking up, so I had to hard power cycle it somewhat frequently. I ran into several cases where files I had been working on prior to the crash would revert to a copy several hours old. I'd edit a file and save it several times while working on it, then the system would lock up and I'd be back to several hours before.

Because of these issues, I tend to avoid XFS. It seems like the XFS fsck isn't as mature as EXT, probably because XFS almost never has to fsck but ext2/3/4 do so regularly.

But, I'll admit that these experiences were probably 5 years ago. Hopefully they're better now. Just thought I'd pass along my experience.

In retrospect, I realize that EXT3 at that time also had corruption issues. But I run hundreds of EXT3-based servers now and can't remember the last time a hard power cycle caused corruption.

Really, the thing that really soured me on XFS was the fsck taking so much RAM and thrashing the system. In the case of our mirror server, it could afford to be down. If this was a business server, knowing that fsck would take a while but not days would have been critical.