Open icebluey opened 3 years ago
If there is only one metadata BG (this is not clear from the truncated btrfs fi usage output, but I'm guessing there is either only one or only one that has free space) and no more metadata chunks can be allocated, then replace is not possible. Replace will lock the only writable metadata BG, no additional writable BGs can be allocated, and then the filesystem cannot be modified any more, including to do the necessary metadata updates to replace a disk.
Increasing the size of the device may suffice as a workaround, or adding at least 2 devices for more space before replacing the missing disk.
The kernel might need to ensure that there is enough space for the global reserve without counting the contribution from the N metadata block groups that have the most free space, where N = 1 (balance) + number_of_disks (for scrub or replace to lock one BG on each disk). That would mean there is more space dedicated to metadata on such a tiny filesystem, but would allow RAID profiles to work on small filesystem sizes.
@Zygo I found another problem #363
btrfs-progs: v5.11.1 linux kernel: 5.10.19
I tried several times:
But there was still space left.
dmesg output: