How to disable features in an xfs file system to make it compatible with an older kernel?

I am using a rocky8 system on which I need to build, install and run a 3.10 kernel.

I managed to get it to build and install, but when booting it up I get the error message:

XFS (sda1): Superblock has unknown read-only compatible features (0x4) enabled.

I guess this it happening because the fs is formatted using an updated mkfs which formats the device with features that are not supported by the older kernel.

So, how can I (if possible) disable those newer features so I can boot the older kernel?

Thanks.


Solution 1:

In this case, you will likely have to reformat the file system. In most cases, file system parameters cannot be changes, although you may be able to change them by booting into the normal kernel and modifying them with xfs_admin -O (see the manual page for details).

However, do note that trying to use a 3.10 kernel is almost certainly going to result in breakage. RHEL-compatible OSes often contain additional patches and features in their kernel, and the binaries on these OSes will often be designed to take advantage of the exact kernel version they're shipped with, since Red Hat knows what that is. So you may find that even though the disk is formatted correctly, using a RHEL 7-equivalent kernel for a RHEL 8-equivaent system results in things working oddly or not at all. A different approach would be prudent.