12

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

0
9

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.

4
  • 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
8

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
versionnum [0xb5b4+0x8a] = V4,NLINK,DIRV2,ATTR,ALIGN,DALIGN,LOGV2,EXTFLG,MOREBITS,ATTR2,LAZYSBCOUNT,PROJID32BIT

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

xfs_db -r /dev/...
xfs_db> version
versionnum [0xb4a5+0x18a] = V5,NLINK,DIRV2,ALIGN,LOGV2,EXTFLG,MOREBITS,ATTR2,LAZYSBCOUNT,PROJID32BIT,CRC,FTYPE,FINOBT
1
  • Great! This also works for non-mounted partitions!
    – Marcus
    Feb 5 at 17:07
0

We can check using below command.

# yum list installed | grep xfs

enter image description here

# yum info xfsprogs

enter image description here

1
  • 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.