4

There is a possibility to attach single bcache cache drive to multiple backing devices. Since bcache is not aware about filesystem which lies on top, this means it is not aware about any software RAID configration of those devices to my knowledge.

An example: 3 drives with Btrfs RAID1 (2 copies) on top of bcache with an additional SSD for writearound cache. Bcache isn't aware about RAID1 and data duplication on disks, so each block read from separate drives will be cached separately. This means the data will be duplicated in the cache. This also means, that there is always 50% of cache miss for the data which was already cached from one backing device block, but wasn't from the other. This makes cache less efficient in RAID configurations with data duplication.

A more efficient cache alternative to the example above, would be (I guess) a mix of linux RAID, bcache and Btrfs: Btrfs (non-RAID) on top of bcache on top of md-raid / lvm RAID1 on disks. But then I'd loose Btrfs checksumming of each copy of data block in RAID, and I couldn't create RAID1 for data and RAID1c3 for metadata.

Is what I wrote above true? Are there any better cache configurations to avoid duplication of data in cache in RAID1 setups?

1 Answer 1

1

What works for me is caching the entire array instead of each device behind the array. Cache the RAID instead of RAIDing the caches.

It's discussed more in detail here

1
  • 1
    It is not possible to cache any arrays here as this is about btrfs' RAID, not btrfs on top of blockdev RAID.
    – Atemu
    Commented Dec 24, 2021 at 13:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .