df free space not correct with raid1 pools with an odd number of devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

Kernel: 5.7.8
btrfs-progs 5.7

Noticed that df reports the wrong free space when used on a raid1
btrfs pool with an odd number of devices, e.g.:

2 x 500GB (correct)

Filesystem      Size  Used Avail Use% Mounted on
/dev/sdd1       466G  3.4M  465G   1% /mnt/cache

3 x 500GB (not correct)

Filesystem      Size  Used Avail Use% Mounted on
/dev/sdd1       699G  3.4M  466G   1% /mnt/cache

btrfs fi usage -T /mnt/cache
Overall:
    Device size:                   1.36TiB
    Device allocated:              4.06GiB
    Device unallocated:            1.36TiB
    Device missing:                  0.00B
    Used:                        288.00KiB
    Free (estimated):            697.61GiB      (min: 697.61GiB)
    Data ratio:                       2.00
    Metadata ratio:                   2.00
    Global reserve:                3.25MiB      (used: 0.00B)
    Multiple profiles:                  no

             Data    Metadata  System
Id Path      RAID1   RAID1     RAID1    Unallocated
-- --------- ------- --------- -------- -----------
 1 /dev/sdd1       -   1.00GiB 32.00MiB   464.73GiB
 2 /dev/sdg1 1.00GiB         -        -   464.76GiB
 3 /dev/sdb1 1.00GiB   1.00GiB 32.00MiB   463.73GiB
-- --------- ------- --------- -------- -----------
   Total     1.00GiB   1.00GiB 32.00MiB     1.36TiB
   Used        0.00B 128.00KiB 16.00KiB





Same for 5 devices and I assume any other odd number of devices:

5 x 500GB

Filesystem      Size  Used Avail Use% Mounted on
/dev/sdd1       1.2T  3.4M  931G   1% /mnt/cache

btrfs fi usage -T /mnt/cache
Overall:
    Device size:                   2.27TiB
    Device allocated:              4.06GiB
    Device unallocated:            2.27TiB
    Device missing:                  0.00B
    Used:                        288.00KiB
    Free (estimated):              1.14TiB      (min: 1.14TiB)
    Data ratio:                       2.00
    Metadata ratio:                   2.00
    Global reserve:                3.25MiB      (used: 0.00B)
    Multiple profiles:                  no

             Data    Metadata  System
Id Path      RAID1   RAID1     RAID1    Unallocated
-- --------- ------- --------- -------- -----------
 1 /dev/sdd1       -         - 32.00MiB   465.73GiB
 2 /dev/sdg1       -   1.00GiB        -   464.76GiB
 3 /dev/sdb1       -         - 32.00MiB   465.73GiB
 4 /dev/sde1 1.00GiB   1.00GiB        -   463.76GiB
 5 /dev/sdf1 1.00GiB         -        -   464.76GiB
-- --------- ------- --------- -------- -----------
   Total     1.00GiB   1.00GiB 32.00MiB     2.27TiB
   Used        0.00B 128.00KiB 16.00KiB



Is this a known issue, and if not would it be a btrfs or df problem?

Thanks,
Jorge



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux