Monitoring XFS filesystem health in Linux

Truthfully there isn't much you can do to monitor the operational health of the filesystem itself. This thread explains the reasons why you can't perform an fsck-style check on a filesystem which is online as read/write.

In part, you should trust that as a journalling filesystem, XFS is doing it's best to keep your data in good health. You may also take some solace in knowing that xfs_check is much faster than fsck.ext3 and XFS doesn't stipulate a periodic checks in the same way as ext3's 180 day / x mounts rule.


Edit to comments:

While I understand that you're once bitten, twice shy. I can assure you that "complete meltdown" isn't a systematic issue associated with UNIX filesystems. In my experience such events tend only to materialise in hand with hardware failure, user error (no disrespect intended), or an unfortunate mixture of both. However this is kind of hard to reason with you on a technical level without some very specific details of what went wrong with your previous ext3 install.


Put the filesystem on a LVM logical volume, create a temporary snapshot from the logical volume and then fsck this snapshot (while the logical volume is still online).

Maybe Theodore Ts'o's e2croncheck script for ext3 will get you started.

(As 3dinfluence mentioned: ZFS is definitely the better solution...)


I noticed weird stuff happen

Then the issue is not the filesystem (or at least it's extremely unlikely). ext3 is one the most used FS and any bug severe enough to cause catastrophic corruption should have already been found and fixed.

The cause lies elsewhere, possibly in the hardware itself (maybe the RAM).

To answer you question: you can check XFS filesystem online, but only if it's mounted read-only.


Checking the consistency of any filesystem that is currently mounted is simply NOT recommanded.