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

Arno Wagner <[email protected]> Mon, 11 Sep 2023 00:05:13 +0200
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
On Sun, Sep 10, 2023 at 18:53:04 CEST, Michael Kjörling wrote:
> On 10 Sep 2023 18:12 +0300, from [email protected] (Горбешко Богдан):
> > 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?
> 
> _My understanding_ (which may be wrong) is that this is not what
> dm-integrity is intended for; nor does it look like it supports it.
 
It is not. What this needs is things like RAID 1/5/6 (which can 
be done in files) and some specialized tools. 

Incidentally, "checksums" do never support recovery from 
errors. What you need for that is error correcting codes.
Transparently, RAID is probably the easiest option in Linux
and the one the works on sector-level. Given that modern drives
(HDD and SSDs) already do extensive error-correction, you probably
need to deal with whole-sector loss (or worse) to get any
additional effect. 

You can do RAID wia the md layer or integrated in some 
filesystems. 

If this is about some embedded device having its storage 
survive long-term, I suggest going for industrial flash
instead (often PCMCIA, sometimes SD) as that can be 
gotten with 10 years and more data lifetime. 

Regards,
Arno


-- 
Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: [email protected]
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. -- Plato

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier