OverlayFS with SD card and LUKS encrypted MD RAID?

Hi,
I ave Turris Omnia with two internal drives and 64GB SD card; currently I have created MD-RAID 1 on top of the two rather noisy SATA HDDs which is also encrypted using LUKS, so I am thinking of adding a 64GB SD card I have spare from my camera after being replaced with 128GB version.

What I’d like to achieve is a persistent storage that will create an persistent overlay over the LUKS encrypted MD-RAID so that the spinning disks will be used less often; I would like the overlay filesystem to be a mountpoint that will first store data (non-persistently) in a RAM (let’s say I allocate 512MB), then it will write the changes to the silent SD card and after that it will commit the made changes to the LUKS encrypted MD RAID, is there a combination of tools in Turris OS or Linux in general which I can use to achieve this easily?

“overlay” kind of filesystems need your explicit decision which subtrees are located on which devices, I believe. What you want sounds more like bcache (or bcachefs). However, I can’t see a kernel module for bcache provided on Omnia ATM. (I might be wrong there.)

I know the explicit subtree, the entire /mnt/int_drives_01/ mount point… I’ll check the bcache…

I meant explicit decision about moving between SD card and the rotating drive(s), in your case. BTW, RAM caching should be done by default, regardless of filesystem.

I’d lie the writes to be pushed to the HDD once SD card is full or upon graceful / ungraceful shutdown (reboot).