All of lore.kernel.org
 help / color / mirror / Atom feed
* df free space not correct with raid1 pools with an odd number of devices
@ 2020-07-23 10:24 Jorge Bastos
  2020-07-24  4:40 ` Chris Murphy
  0 siblings, 1 reply; 10+ messages in thread
From: Jorge Bastos @ 2020-07-23 10:24 UTC (permalink / raw)
  To: Btrfs BTRFS

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-07-25 10:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23 10:24 df free space not correct with raid1 pools with an odd number of devices Jorge Bastos
2020-07-24  4:40 ` Chris Murphy
2020-07-24  6:53   ` Rolf Wald
2020-07-24  8:16   ` Jorge Bastos
2020-07-24 20:46     ` Chris Murphy
2020-07-25  2:19       ` Chris Murphy
2020-07-25  7:30       ` Andrei Borzenkov
2020-07-25  7:43         ` Andrei Borzenkov
2020-07-25 10:04           ` Jorge Bastos
2020-07-25 10:21             ` Andrei Borzenkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.