https://raid.wiki.kernel.org/index.php?title=Dm-integrity&feed=atom&action=historyDm-integrity - Revision history2024-03-29T12:59:24ZRevision history for this page on the wikiMediaWiki 1.19.24https://raid.wiki.kernel.org/index.php?title=Dm-integrity&diff=6260&oldid=prevAnthony Youngman: Headers and Footers2019-11-30T20:24:19Z<p>Headers and Footers</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 20:24, 30 November 2019</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">{| style="border:1px solid #aaaaaa; background-color:#f9f9f9;width:100%; font-family: Verdana, sans-serif;"</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">|- padding:5px;padding-top:0.5em;font-size: 95%; </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">| Back to [[What do you want in your stack?]] <span style="float:right; padding-left:5px;">Forward to [[RAID and filesystems]]</span></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">|}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>dm-integrity has been around a while - version 1.0 was released with kernel 4.12 - but it is written and maintained by the crypto</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>dm-integrity has been around a while - version 1.0 was released with kernel 4.12 - but it is written and maintained by the crypto</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>people as part of LUKS, so has a bunch of issues when used with other features such as raid. The good news is that this is</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>people as part of LUKS, so has a bunch of issues when used with other features such as raid. The good news is that this is</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 39:</td>
<td colspan="2" class="diff-lineno">Line 44:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Once all the drives have been copied, an integrity check needs to be run to ensure each stripe is read in its entirety and all damaged</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Once all the drives have been copied, an integrity check needs to be run to ensure each stripe is read in its entirety and all damaged</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>sectors are re-calculated and rewritten.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>sectors are re-calculated and rewritten.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">{| style="border:1px solid #aaaaaa; background-color:#f9f9f9;width:100%; font-family: Verdana, sans-serif;"</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">|- padding:5px;padding-top:0.5em;font-size: 95%; </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">| Back to [[What do you want in your stack?]] <span style="float:right; padding-left:5px;">Forward to [[RAID and filesystems]]</span></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">|}</ins></div></td></tr>
</table>Anthony Youngmanhttps://raid.wiki.kernel.org/index.php?title=Dm-integrity&diff=6255&oldid=prevAnthony Youngman: New page2019-11-30T19:14:34Z<p>New page</p>
<p><b>New page</b></p><div>dm-integrity has been around a while - version 1.0 was released with kernel 4.12 - but it is written and maintained by the crypto<br />
people as part of LUKS, so has a bunch of issues when used with other features such as raid. The good news is that this is<br />
simply because it hasn't been used and tested outside of LUKS, and any issues found will be treated as bugs and fixed. The bad news<br />
is that bug fixes always take time and effort.<br />
<br />
To use dm-integrity, the kernel option CONFIG_DM_INTEGRITY in Device Drivers/Multi-device support<br />
(RAID and LVM) must be enabled. This will automatically enable CONFIG_BLK_DEV_INTEGRITY.<br />
<br />
You will also need the device mapper library (part of the LVM2 package) and integritysetup (part of the cryptsetup package).<br />
<br />
Run integritysetup to set up a partition with integrity support. By default data and metadata are stored on the same partition,<br />
but it looks as if it is possible to store the metadata on a separate <br />
partition, so you can enable integrity on an existing partition.<br />
<br />
This makes it look as if adding integrity does not change the partition id, but I don't know.<br />
<br />
=== Using dm-integrity in an array ===<br />
<br />
dm-integrity should be enabled as a matter of course with any raid array, but at present this would be a little risky.<br />
There are issues with it at present because it's all new, but getting it to work should be a matter of urgency. At<br />
present, because raid is intended to protect against disk failure, without extra help it cannot detect and protect against<br />
corruption.<br />
<br />
If data is corrupted on read, dm-integrity returns a read error. At present, I don't know what exact error code it returns, or<br />
whether raid is equipped to handle it, but when it all works, this will cause raid's error-handling code to kick in and return the<br />
correct data.<br />
<br />
=== Using dm-integrity to recover an array ===<br />
<br />
At the end of the day, if you lose too many drives you've lost it, but if you simply have a bunch of drives kicked as a result of<br />
unrecoverable read errors, you might be able to recover the array if you can salvage the rest of the data. It is intended that you can configure it<br />
such that "read before write" will fail - it should return an error of EILSEQ for an integrity failure.<br />
<br />
The new device needs to be set up by integritysetup with the --no-wipe option. This should leave the drive unreadable. A ddrescue copy<br />
will validate all the data that ddrescue salvages, but anything that won't copy will be left unreadable on the new drive. Obviously, if the array<br />
is still readable, dropping the new drive in will work fine.<br />
<br />
If, however, multiple drives have failed, you need to copy all drives, and hope that no individual stripe has suffered multiple failures.<br />
Once all the drives have been copied, an integrity check needs to be run to ensure each stripe is read in its entirety and all damaged<br />
sectors are re-calculated and rewritten.</div>Anthony Youngman