I have read a lot of caveats about interpreting the free space
reported for btrfs volumes, but could not find anything about the
perceived inconsistency in the disk usage reporting described below.

I have a btrfs volume with about 135GiB used for data, as reported by
`df`, `btrfs fi show` and `btrfs fi usage` alike:

# btrfs filesystem show /volumes/main/
Label: 'main'  uuid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
        Total devices 1 FS bytes used 134.12GiB
        devid    1 size 193.43GiB used 165.01GiB path /dev/sda2

However, `btrfs fi du` reports ~17GiB exclusive usage and ~80GiB
shared usage, which adds up to only 97GiB (compared to the 135GiB I
would expect):

# btrfs filesystem du -s /volumes/main/
     Total   Exclusive  Set shared  Filename
   1.73TiB    17.20GiB    80.13GiB  /volumes/main/

(The reported total usage exceeding the disk capacity by an order of
magnitude is expected as the volume contains many snapshots.)

The mount point corresponds to the root subvolume, thus all subvolumes
should be accounted for by `btrfs fi du` (according to its

# mount | grep /volumes/main
/dev/sda2 on /volumes/main type btrfs

Do I misunderstand the meaning of exclusive and shared usage or is
there some other issue causing this behaviour? I would expect the disk
usage reported by `df`, `btrfs fi show` and `btrfs fi usage` to be the
sum of the exclusive and shared usage reported by `btrfs fi du`.

The output of `btrfs fi usage`, for completeness's sake:

# btrfs filesystem usage /volumes/main/
    Device size:                 193.43GiB
    Device allocated:            165.01GiB
    Device unallocated:           28.41GiB
    Device missing:                  0.00B
    Used:                        134.12GiB
    Free (estimated):             57.00GiB      (min: 57.00GiB)
    Data ratio:                       1.00
    Metadata ratio:                   1.00
    Global reserve:              194.72MiB      (used: 0.00B)

Data,single: Size:162.00GiB, Used:133.41GiB (82.35%)
   /dev/sda2                     162.00GiB

Metadata,single: Size:3.01GiB, Used:720.88MiB (23.41%)
   /dev/sda2                       3.01GiB

System,single: Size:4.00MiB, Used:48.00KiB (1.17%)
   /dev/sda2                       4.00MiB

   /dev/sda2                      28.41GiB



Reply via email to