determining superblock version?
Eric Sandeen
sandeen at sandeen.net
Tue Jun 7 12:12:21 CDT 2016
On 6/7/16 5:51 AM, Emmanuel Florac wrote:
> Hi all,
>
> as you know kernel prior to 3.16 won't support properly v5 superblocks.
> xfsprogs v 3.2.4 and higher defaults to v5 superblocks. This bit quite
> a lot of people a year ago or so, when some distributions shipped 3.2.4
> xfsprogs with older kernels.
>
> Anyway, I was surprised to find no easy way to find out the superblock
> version of an xfs FS. The best I've come across is
>
> xfs_db /dev/this
> sb
> p
>
> <snip>
> versionnum = 0xb4a5
> </snip>
There is certainly some confusion about naming.
Version 5, compat/incompat features, feature bits, feature names, etc.
> So I suppose that the 5 in the end means that the superblock is v5? Can
> anyone confirm please? The man page still pretends that the last number
> should be 1 to 4, which is confusing.
Yes, the last bits contain the version number (masked by 0xf, see below)
#define XFS_SB_VERSION_1 1 /* 5.3, 6.0.1, 6.1 */
#define XFS_SB_VERSION_2 2 /* 6.2 - attributes */
#define XFS_SB_VERSION_3 3 /* 6.2 - new inode version */
#define XFS_SB_VERSION_4 4 /* 6.2+ - bitmask version */
#define XFS_SB_VERSION_5 5 /* CRC enabled filesystem */
#define XFS_SB_VERSION_NUMBITS 0x000f
feel free to send a man page patch :)
> Oh by the way I think the trick to create a v4 filesystem with mkfs.xfs
> higher than 3.2.4 ( mkfs.xfs -m crc=0,finobt=0 /dev/this ) should be in
> the FAQ, with a line like this:
>
> Mounting the filesystem fails, and output from dmesg says "Version 5
> superblock detected." What should I do?
>
> v5 superblocks require a kernel v3.16 of higher. If you need your
> xfs filesystem to be usable with older kernel, use the following
> options to mkfs.xfs :
>
> mkfs.xfs -m crc=0,finobt=0 /dev/this
finobt=0 should not be needed, it should be off if crc=0 AFAIK.
However, -n ftype=1 may still be enabled, and older kernels may have an
issue with that as well.
Feel free to add this to the wiki (can new accounts still be created?)
-Eric
More information about the xfs
mailing list