How to check the version of a XFS filesystem on a system, whether it is V5 or later?


Since version 3.15, the kernel tells you the version of XFS used in each filesystem as it mounts it; dmesg | grep XFS should give you something like

[1578018.463269] XFS (loop0): Mounting V5 Filesystem

Instead of loop0 on your system you'll get the underlying device, and V5 will be replaced by whatever version your filesystem uses.

Older kernels officially supported XFS version 4 filesystems, but could mount version 5 filesystems (since mid 2013); for the latter, the kernel would print

Version 5 superblock detected. This kernel has EXPERIMENTAL support enabled!

when the filesystem was mounted.

  • I get something like this: 1.342982] SGI XFS with ACLs, security attributes, large block/inode numbers, no debug enabled [ 1.345446] XFS (dm-0): Mounting Filesystem [ 1.497979] XFS (dm-0): Starting recovery (logdev: internal) [ 1.587471] XFS (dm-0): Ending recovery (logdev: internal) [ 6.980611] XFS (sda2): Mounting Filesystem [ 9.675872] XFS (sda2): Ending clean mount Sep 15 '16 at 19:19
  • @MikasaAckerman OK, that means you're using a kernel older than 3.15, and a version 4 filesystem (see my updated answer for details). Sep 15 '16 at 21:01
  • This answer does not help, when you are unable to mount the filesystem (which in turn could be the reason why you want to find out the version number at all). Happens when you try to mount an XFS filesystem with an older kernel.
    – U. Windl
    Feb 15 at 8:16
  • @U.Windl yes, see sebasth’s answer. Feb 15 at 9:03

You can check the on disk format version of a XFS file system with xfs_db.

Example output of an old (V4) XFS file system on my system:

xfs_db -r /dev/...
xfs_db> version

Output of a new (V5) XFS file system (created with xfsprogs version 4.9.0):

xfs_db -r /dev/...
xfs_db> version
  • Great! This also works for non-mounted partitions!
    – Marcus
    Feb 5 at 17:07

We can check using below command.

# yum list installed | grep xfs

enter image description here

# yum info xfsprogs

enter image description here

  • 4
    This only shows the installed version of xfsprogs tools. The question is about the the version of file system on disk format on an existing file system. xfsprogs version doesn't tell which on disk format version is used on existing file systems: file systems created with older versions of xfsprogs will have an older on disk format version.
    – sebasth
    Aug 26 '18 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.