RAID1 on top of dm-integrity -- what if I lose the tags?
I'm labbing a storage setup for the NAS that will hold my backups and easily replaceable stuff. I want it to be fairly cheap, modestly large, and I'm scared of silent data corruption. That's why I decided on RAID1 (which requires only two disks) and dm-integrity.
My initial setup was:
- two old 1TB HDDs (upcycled from laptops)
- dm-integrity on each HDD
- md-raid raid1 on top of dm-integrity volumes
The problem with that setup was the abysmal write performance. The slowdown was caused by dm-integrity, which stores tags (hashes of disk sectors) on that same disk. Constant seeking between data and tags killed the throughput.
I moved dm-integrity tags onto a separate SSD. This enabled me to use full write speed on the HDDs, but compromised the data protection: if the SSD fails, I lose dm-integrity tags exactly when I need them most. The RAID can still be assembled from the HDDs; in fact, one has to take extra steps to prevent md-raid from using HDDs and force it to use dm-integrity volumes instead. However, tags can't be re-calculated from the data, so my recovery plan would be:
- get new disks
- create dm-integrity volumes on them
- copy the data over — risking to run into corrupted data that md-raid won't be able to detect and correct
How can I have the cake and eat it too? So far my only idea is to get an additional SSD and create another RAID1 to store tags. This limits me in the choice of hardware for the NAS (needs two SSD slots instead of one). Are there any other options? I am aware of ZFS, but I want to do this with Linux and I don't like the problems that OpenZFS licensing causes.
Posted Feb 20, 2026, 4:29 PM UTC