Skip to content

inspect-internal list-chunks does not show usage on RAID-6 #1055

@rzsn

Description

@rzsn

Hello,
I am trying to figure out where I got the 700GB of unusable free space on my FS (basically the 0.71% of a 98TiB array):

Overall:
    Device size:                 130.97TiB
    Device allocated:            130.93TiB
    Device unallocated:           40.11GiB
    Device missing:                  0.00B
    Device slack:                    0.00B
    Used:                        129.98TiB
    Free (estimated):            738.63GiB      (min: 721.91GiB)
    Free (statfs, df):           738.59GiB
    Data ratio:                       1.33
    Metadata ratio:                   3.00
    Global reserve:              512.00MiB      (used: 0.00B)
    Multiple profiles:                  no

Data,RAID6: Size:97.85TiB, Used:97.16TiB (99.29%)

but the suggested list-chunks is not really helpful:

Devid PNumber       Type/profile     PStart     Length       PEnd LNumber     LStart Usage%
----- ------- ------------------ ---------- ---------- ---------- ------- ---------- ------
    1       1        Data/RAID6     1.00MiB    6.00GiB    6.00GiB   14771  119.46TiB   0.00
    1       2        Data/RAID6     1.00GiB    6.00GiB    7.00GiB       1   37.03GiB   0.00
    1       3        Data/RAID6     2.00GiB    6.00GiB    8.00GiB       2   43.03GiB   0.00
    1       4        Data/RAID6     3.00GiB    6.00GiB    9.00GiB       3   49.03GiB   0.00
    1       5        Data/RAID6     4.00GiB    6.00GiB   10.00GiB       4   55.03GiB   0.00
    1       6        Data/RAID6     5.00GiB    6.00GiB   11.00GiB       5   61.03GiB   0.00
    1       7        Data/RAID6     6.00GiB    6.00GiB   12.00GiB       6   67.03GiB   0.00
    1       8        Data/RAID6     7.00GiB    6.00GiB   13.00GiB       7   73.03GiB   0.00
    1       9        Data/RAID6     8.00GiB    6.00GiB   14.00GiB       8   79.03GiB   0.00
    1      10        Data/RAID6     9.00GiB    6.00GiB   15.00GiB       9   85.03GiB   0.00

Can the list-chunks be fixed, or is there another command that works on the logical side of the RAID functionality ?

# btrfs version
btrfs-progs v6.17
-EXPERIMENTAL -INJECT -STATIC +LZO +ZSTD -UDEV +FSVERITY +ZONED CRYPTO=builtin

# uname -a
Linux ******.***.*******.*** 6.17.6-gentoo-x86_64 #1 SMP PREEMPT_DYNAMIC Sat Nov  1 12:43:31 CET 2025 x86_64 Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz GenuineIntel GNU/Linux

Tried balacing up to 95 but no unallocated space was recovered, however given the figures above the only option is to balance for me is to go straight with 100 - which is sort of a full defragmentation I hope. But I am unable to track any progress due to lack of the usage metrics in the list-chunks for my array.

I am really having hard time understanding what is going on, as the FS keeps DoS-sing me, after I deplete the unallocated portion - further writes go with huge disk activity and at single kB/s of speeds which tells me something is really wrong here.

Does BTRFS have a RMW process in a RAID data chunk, or its doing a SMR-like append-only operation, and the whole 6GiB slice of 8x1GiB chunks has to be copied over in order to be compacted, and allow further writes when the volume is that much full?

I would then really appreciate if the FREE space indicator is split into two distinct metrics - one for TRUE FREE (virgin untouched tail of the chunk) and a FALSE FREE (dirty CoW affected area that is no longer used, but its also not free to direct use and requires rebalance / defragmentation).

Further info:

/dev/***1 on /mnt/******** type btrfs (rw,noatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/)

And one strange things is that I am getting thousands of such warnings on stderr before list-chunks produces anything:

WARNING: blockgroup 135151418867712 not found
WARNING: blockgroup 135157861318656 not found
WARNING: blockgroup 135164303769600 not found
WARNING: blockgroup 135170746220544 not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions