0

I have a file formatted as a btrfs filesystem. I can loop mount it and use it normally. I'd like to run btrfs check on this file, but an error is generated.

First I tried with just the file:

$ sudo btrfs check ./sage-M.btrfs 
couldn't open because of unsupported option features (10).
ERROR: cannot open file system

That didn't work so I thought maybe it needed to be a device, but that doesn't seem to help:

$ sudo losetup --show -v -P -f ./sage-M.btrfs 
/dev/loop0
$ sudo btrfs check /dev/loop0
couldn't open because of unsupported option features (10).
ERROR: cannot open file system

What is/are "option features (10)"? How can I run btrfs check on this file?

BTW:

$ sudo btrfs --version
btrfs-progs v4.9.1

1 Answer 1

2

The "unsupported option features" means that the BTRFS filesystem in the file has features enabled which are not supported by either your BTRFS tools or Linux kernel. This can happen when:

  • The filesystem was created with a version of btrfs-progs which is newer than the version currently in use.
  • The Linux kernel has been downgraded, causing the BTRFS kernel-space code to lose functionality required by the filesystem in question. You can see a kernel version to BTRFS features mapping here.

An example would be if the filesystem uses ZSTD compression yet btrfs-progs is an older version which does not support ZSTD.

7
  • Could using mount option compress=zstd with my version of btrfs-progs be the issue? Commented Sep 4, 2018 at 2:52
  • ... for example, maybe here my kernel is ahead of my btrfs-progs. And is there a mapping from "option features (XX)" to something concrete? What is "10" here? Commented Sep 4, 2018 at 4:40
  • I don't thing so, but you can test the theory by not using ZSTD compression; It won't hurt anything to try. I once found a mapping for the confusing "10", but I don't remember where. If you run mkfs.btrfs -O list-all you'll get a list of the features supported by btrfs-progs, but I don't know how to list the features of a specific BTRFS filesystem. Try asking in the BTRFS IRC chat on freenode or on their mailing list. Commented Sep 4, 2018 at 7:52
  • btrfs inspect-internal dump-super ./sage-M.btrfs shows, in addition to many other things, incompat_flags 0x155 ( ... unknown flag: 0x10 ). Looking at my tagged version of btrfs-progs for file ctree.h, BTRFS_FEATURE_INCOMPAT_SUPP does not include the ZSTD flag. So, your initial statement is correct, "... the BTRFS filesystem in the file has features enabled which are not supported by either your BTRFS tools ...". In my case, the kernel is using features that are not present in my btrfs-progs. Fedora btrfs-progs lag features present in the kernel. An issue has been submitted. Commented Sep 4, 2018 at 21:15
  • If you update your answer, I'll upvote and accept. Commented Sep 4, 2018 at 21:16

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.