I'm designing a machine, to serve as a NAS. My interest is hobby-level.
I would use mdadm to software raid a couple of same-size hdds. At first I'd use raid1, but in the future I'd add another disk and convert it to raid5. My understanding is that mdadm can do that in-place. (Yes, I know I should back the data up anyway, first.)
I would use bcache with this raid array, and an ssd, to improve performance. (bcache is a block device caching layer)
I'd put dmcrypt on top of it.
| dmcrypt | | dmcrypt | | bcache | -> | bcache | | mdadm raid1 | | mdadm raid5 | | ssd | hdd1 | hdd2 | | ssd | hdd1 | hdd2 | hdd3 |
I think the only effect this arrangement would have on dmcrypt is to store the dmcrypt header with parity, and cache it to the ssd if it's used often enough. Am I correct that this is safe? Or is there some unknown-to-me issue here, that would cause data loss?