If you are using XFS for USB harddrive now in 21.02, support for your filesystem is probably already dropped in 22.03

I'm sharing this in case someone else is still using XFS...

I recently tried to upgrade my Buffalo WZR-HP-AG300H to OpenWrt 22.03. Upgrade went well... except my USB harddrive with XFS filesystem no longer work.

# opkg install kmod-usb-storage kmod-fs-xfs usbutils
# mkdir -p /mnt/disk && mount -o rw,noexec,noatime -t xfs /dev/sda1 /mnt/disk
mount: mounting /dev/sda1 on /mnt/disk failed: Invalid argument

I checked dmesg and found this peculiar message: "Deprecated V4 format (crc=0) not supported by kernel.".

It turns out my XFS-formatted disk is in old format (https://linuxreviews.org/Prepare_To_Re-Format_If_You_Are_Using_An_Older_XFS_Filesystem) and is no longer supported by OpenWRT.

In most regular Linux distros, your XFS disk is most likely still readable (till 2025). But in the world of OpenWRT, every single byte counts and support for old format weights in many kilobytes, so the team apparently decided to drop old-XFS support much earlier than others.

So, if you are currently using XFS right now in 21.02, make sure backup your files to another disk and be prepared to reformat!
For those who don't have another empty HDD right now, you can stay at OpenWRT 21.02.5... until April 2023.

I believe you can use the sdk to rebuild the xfs kmod with extra options.

I know about that, but I'd say it is not sustainable for these reasons:

  • You will be running a custom, unofficial build of OpenWRT. You must be really careful what you're doing, and if any bugs happen you'll less likely to get help from this forum.
  • Legacy XFS support will be completely removed in 2030. Considering OpenWRT dropped official support of legacy XFS already, this option may become unavailable earlier than other (normal) Linux distros.

My recommendation is still the same: Copy every file of your old-XFS disk to another disk, then reformat the old disk with modern-XFS or other filesystem format which are unlikely to get dropped by OpenWRT team (i.e. ext4 or NTFS)

Personally I wouldn't ride with that opinion, while you are right about every KB counting, xfs is non-default and a rather heavy filesystem anyways, so I'd assume that no one really looked that deeply into the details when upgrading the kernel. If you'd raise a patch enabling support for the old format again, chances probably wouldn't be too bad for this to be considered.

Of course, the only viable long term solution would be to upgrade the on-disk fs, so this would be merely delaying the inevitable by two or three years, but…

1 Like

For the record, at the risk of being nitpicky: OpenWrt did not drop "legacy XFS support", it never had it enabled in the first place (the only relevant commit to the 5.10 config just added the previously absent CONFIG_XFS_SUPPORT_V4 symbol as not set).