Is it possible to set the amount of CRC32C hashes per a data sector in integritysetup?

Горбешко Богдан <[email protected]> Sun, 10 Sep 2023 18:12:49 +0300
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
I'd like to sacrifice a significant amount of disk space (let's say, 
20%) for recovery checksums: in a way RAR or Parchive can do that, or in 
a way it's implemented in some physical-level media (DVD, HDD, digital 
TV, etc.) Some of them store the checksums separately, some among the 
data; my goal is to store them among the data on the same medium.

Currently, I came up with splitting a medium into 6 even partitions and 
making a RAID 5 array out of them. It seems to work, though I was 
suggested that dm-integrity might be a more straightforward solution for 
the task. So, before I started using the RAID 5 solution in practice, 
I'd like to make sure if the same is possible with dm-integrity first.

AFAIU, the primary goal of dm-integrity is checking if the data are not 
corrupted and throwing read errors otherwise. Though it still supports 
checksums besides of hashes. Can they be used for recovering the data 
on-the-fly?

I've read the manual of integritysetup and still not sure if it's 
possible to achieve a significantly big checksum/data ratio. Reducing 
the sector size lower than 512 does not work. If I increase the tag 
size, would it be used to store a larger checksum, or just would be 
padded to store one tiny checksum per a tag? Maybe there is some other way?

Thanks.