I ran out of space in my OpenSUSE partition, which uses btrfs. I booted from a live Ubuntu USB to reallocate some of the space from my Windows partition to the Linux one. It succeeded in shrinking the Windows partition, but when it tried to move/resize the Linux partition, btrfs check failed with the following error:
root@ubuntu:~# btrfs check /dev/nvme0n1p5
Opening filesystem to check...
Checking filesystem on /dev/nvme0n1p5
UUID: 6afe1f98-2fc5-4dd7-a22f-0b9e2f514a71
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space cache
cache and super generation don't match, space cache will be invalidated
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups
ERROR: out of memory
ERROR: Loading qgroups from disk: -2
ERROR: failed to check quota groups
found 65546706944 bytes used, error(s) found
total csum bytes: 59958768
total tree bytes: 1668497408
total fs tree bytes: 1538752512
total extent tree bytes: 53886976
btree space waste bytes: 264382931
file data blocks allocated: 321153744896
referenced 97287462912
extent buffer leak: start 300026445824 len 16384
extent buffer leak: start 300063735808 len 16384
If I ask it to check quota groups specifically, I get:
root@ubuntu:~# btrfs check -Q /dev/nvme0n1p5
Opening filesystem to check...
Checking filesystem on /dev/nvme0n1p5
UUID: 6afe1f98-2fc5-4dd7-a22f-0b9e2f514a71
Print quota groups for /dev/nvme0n1p5
UUID: 6afe1f98-2fc5-4dd7-a22f-0b9e2f514a71
ERROR: out of memory
ERROR: Loading qgroups from disk: -2
extent buffer leak: start 300026445824 len 16384
extent buffer leak: start 300063735808 len 16384
I have already tried rebalancing (which required adding another device and then removing it because of the lack of free space), btrfs check --repair, and btrfs check --init-extent-tree, but nothing has changed.
After rebalancing I had just enough free space to delete some Docker images and free up space, but now I still only have about 5GB free to work with.
The only relevant thing I have been able to find online is Bug 183471 - BTRFS progs Unfixable btrfs qgroups with out of memory message, but there are no further comments on that bug report from 2016.
I am not 100% opposed to reinstalling OpenSUSE, but I would rather not have to if this is fixable. Any advice is appreciated.
I also posted this on Stack Exchange (Super User).](https://superuser.com/questions/1710200/btrfs-fails-to-load-qgroups-from-disk-with-error-2-out-of-memory)