1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/metadata
David Teigland d9e8895a96 Allow dm-integrity to be used for raid images
dm-integrity stores checksums of the data written to an
LV, and returns an error if data read from the LV does
not match the previously saved checksum.  When used on
raid images, dm-raid will correct the error by reading
the block from another image, and the device user sees
no error.  The integrity metadata (checksums) are stored
on an internal LV allocated by lvm for each linear image.
The internal LV is allocated on the same PV as the image.

Create a raid LV with an integrity layer over each
raid image (for raid levels 1,4,5,6,10):

lvcreate --type raidN --raidintegrity y [options]

Add an integrity layer to images of an existing raid LV:

lvconvert --raidintegrity y LV

Remove the integrity layer from images of a raid LV:

lvconvert --raidintegrity n LV

Settings

Use --raidintegritymode journal|bitmap (journal is default)
to configure the method used by dm-integrity to ensure
crash consistency.

Initialization

When integrity is added to an LV, the kernel needs to
initialize the integrity metadata/checksums for all blocks
in the LV.  The data corruption checking performed by
dm-integrity will only operate on areas of the LV that
are already initialized.  The progress of integrity
initialization is reported by the "syncpercent" LV
reporting field (and under the Cpy%Sync lvs column.)

Example: create a raid1 LV with integrity:

$ lvcreate --type raid1 -m1 --raidintegrity y -n rr -L1G foo
  Creating integrity metadata LV rr_rimage_0_imeta with size 12.00 MiB.
  Logical volume "rr_rimage_0_imeta" created.
  Creating integrity metadata LV rr_rimage_1_imeta with size 12.00 MiB.
  Logical volume "rr_rimage_1_imeta" created.
  Logical volume "rr" created.
$ lvs -a foo
  LV                  VG  Attr       LSize  Origin              Cpy%Sync
  rr                  foo rwi-a-r---  1.00g                     4.93
  [rr_rimage_0]       foo gwi-aor---  1.00g [rr_rimage_0_iorig] 41.02
  [rr_rimage_0_imeta] foo ewi-ao---- 12.00m
  [rr_rimage_0_iorig] foo -wi-ao----  1.00g
  [rr_rimage_1]       foo gwi-aor---  1.00g [rr_rimage_1_iorig] 39.45
  [rr_rimage_1_imeta] foo ewi-ao---- 12.00m
  [rr_rimage_1_iorig] foo -wi-ao----  1.00g
  [rr_rmeta_0]        foo ewi-aor---  4.00m
  [rr_rmeta_1]        foo ewi-aor---  4.00m
2020-04-15 12:10:32 -05:00
..
cache_manip.c cov: widen before calculating min_chunk_size 2020-02-04 17:22:06 +01:00
integrity_manip.c Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
lv_alloc.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lv_manip.c Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
lv.c Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
lv.h Remove unused clvm variations for active LVs 2018-06-07 16:17:04 +01:00
merge.c Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
metadata-exported.h Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
metadata.c drop warnings about missing pvs in foreign vgs 2019-12-11 12:56:15 -06:00
metadata.h metadata: add vg_from_config_tree 2019-11-27 11:13:47 -06:00
mirror.c fix dev_unset_last_byte after write error 2019-11-13 09:36:58 -06:00
pool_manip.c cachevol: move flag setting after taking archive 2019-10-17 13:03:50 +02:00
pv_alloc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_list.c move pv_list code into lib 2020-04-13 10:04:14 -05:00
pv_manip.c pvresize: add missing return 2018-06-08 14:36:56 +02:00
pv_map.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
pv_map.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
pv.c lvmcache: renaming functions and variables 2019-08-16 13:26:11 -05:00
pv.h metadata: import device name hint from metadata 2019-09-30 11:38:10 -05:00
raid_manip.c Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
segtype.c segtype: add linear 2018-06-05 16:23:18 +02:00
segtype.h Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
snapshot_manip.c Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
takeover_matrix.h lvconvert: add infrastructure for RaidLV reshaping support 2017-02-24 05:20:58 +01:00
thin_manip.c cov: add explicit ret value ignoring 2019-11-14 18:06:42 +01:00
vdo_manip.c vdo: fix slab size bits calculation 2020-02-25 17:43:16 +01:00
vg.c improve reading and repairing vg metadata 2019-06-07 15:54:04 -05:00
vg.h metadata: include description with command in metadata areas 2019-06-20 16:09:05 -05:00
writecache_manip.c writecache: working real dm uuid suffix for wcorig lv 2020-02-20 17:13:43 -06:00