Benjamin Smith
2015-Nov-20 23:02 UTC
[CentOS] EL7: Detecting FS errors on XFS while mounted
Is there a way of checking an XFS filesystem for clean/dirty status while mounted? One of the checks we've long performed is an FS-level error check. This is *not a full-on fsck*, this is "asking the file system if it noted any problems". This is done while the file system is mounted and "hot". For example, here's how we'd check an ext* partition: # debugfs -R "show_super_stats -h" /dev/md127 | grep -i "Filesystem state" We'd look for "Filesystem state: clean" (or something else if not clean). ZFS also allows for a "hot & mounted" check for dirty file system: # zpool status So far, I've been unsuccessful in finding an equivalent for XFS.
John R Pierce
2015-Nov-20 23:18 UTC
[CentOS] EL7: Detecting FS errors on XFS while mounted
On 11/20/2015 3:02 PM, Benjamin Smith wrote:> Is there a way of checking an XFS filesystem for clean/dirty status while > mounted? > > One of the checks we've long performed is an FS-level error check. This is > *not a full-on fsck*, this is "asking the file system if it noted any > problems". This is done while the file system is mounted and "hot". For > example, here's how we'd check an ext* partition: > > # debugfs -R "show_super_stats -h" /dev/md127 | grep -i "Filesystem state" > We'd look for "Filesystem state: clean" (or something else if not clean). > > ZFS also allows for a "hot & mounted" check for dirty file system: > # zpool status > > So far, I've been unsuccessful in finding an equivalent for XFS.xfs_check can only be run on a unmounted file system. if XFS is mounted, its working. if there have been any minor errors it would have repaired them on the fly, if there were serious errors, it would have barfed and gone read-only, with kernel errors logged in dmesg or whatever. zpool status is more reporting on the state of the volume manager side of zpool, whihc is checksumming data blocks as they are written and confirming as they are read. if you're using md raid, you can query the status of the underlying volume iwth mdadm -Q /dev/mdXXX (or -D for more info). -- john r pierce, recycling bits in santa cruz