All of lore.kernel.org
 help / color / mirror / Atom feed
* btrfs raid 1 with a shared fast read cache, and individual slow write caches in front of hard drives, how?
@ 2021-01-03 12:46  
  0 siblings, 0 replies; only message in thread
From:   @ 2021-01-03 12:46 UTC (permalink / raw)
  To: linux-btrfs

­I would like to create a btrfs raid array where one device (either hard drive, SSD or flash drive) can fail, and all the data survives.
Also, I would like to have a write cache in front of all the mechanical drives, so they can stay idle until the write cache if full, or data is requested that is not in the read cache.

I've looked at bcache. This can cache multiple block devices with a single read cache, but it cannot be stacked [1], so I cannot give each hard drive it's own (small) write cache, with a shared large read cache like this:
[1] https://bugzilla.kernel.org/show_bug.cgi?id=211011

+--------------------------------------------+
|         btrfs raid 1 (2 copies) /mnt       |
+--------------+--------------+--------------+
| /dev/bcache3 | /dev/bcache4 | /dev/bcache5 |
+--------------+--------------+--------------+
|              Read Cache (SSD)              |
|                /dev/sda4                   |
+--------------+--------------+--------------+
| /dev/bcache0 | /dev/bcache1 | /dev/bcache2 |
+--------------+--------------+--------------+
| Write Cache  | Write Cache  | Write Cache  |
|(Flash Drive) |(Flash Drive) |(Flash Drive) |
| /dev/sda5    | /dev/sda6    | /dev/sda7    |
+--------------+--------------+--------------+
| Data         | Data         | Data         |
| /dev/sda8    | /dev/sda9    | /dev/sda10   |
+--------------+--------------+--------------+

Would it be a good idea to use dm-cache to create pairs of hard drives and flash drives, and then use bcache on top of that to create a big shared read cache like this?

+--------------------------------------------+
|         btrfs raid 1 (2 copies) /mnt       |
+--------------+--------------+--------------+
| /dev/bcache0 | /dev/bcache1 | /dev/bcache2 |
+--------------+--------------+--------------+
|              Read Cache (SSD)              |
|                /dev/sda4                   |
+--------------+--------------+--------------+
| Logical      | Logical      | Logical      |
| Volume 0     | Volume 1     | Volume 2     |
+--------------+--------------+--------------+
| Cache volume | Cache volume | Cache volume |
|(Flash Drive) |(Flash Drive) |(Flash Drive) |
| /dev/sda5    | /dev/sda6    | /dev/sda7    |
+--------------+--------------+--------------+
| Origin volume| Origin volume| Origin volume|
| =Physical    | =Physical    | =Physical    |
| volume (PV)  | volume (PV)  | volume (PV)  |
| /dev/sda8    | /dev/sda9    | /dev/sda10   |
+--------------+--------------+--------------+

Will this stack survive a drive that goes missing? For instance by pulling out the data cable or the power cable of that drive?
Will this stack survive a drive that is silently corrupting data? For instance by dd'ing random data to it?

How would you solve this problem? 

---

Take your mailboxes with you. Free, fast and secure Mail & Cloud: https://www.eclipso.eu - Time to change!



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-03 12:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-03 12:46 btrfs raid 1 with a shared fast read cache, and individual slow write caches in front of hard drives, how?  

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.