1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 01:55:10 +03:00
lvm2/lib/misc
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
..
crc_gen.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
crc.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
crc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
intl.h doc: change fsf address 2016-01-21 12:11:37 +01:00
last-path-component.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lib.h headers: use configure.h as 1st. header 2018-12-14 15:09:13 +01:00
lvm-exec.c Merge branch 'master' into 2018-05-11-fork-libdm 2018-05-16 13:43:02 +01:00
lvm-exec.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvm-file.c device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
lvm-file.h log: separate output and make it possible to use given FDs 2016-08-09 18:24:45 +02:00
lvm-flock.c pvcreate,pvremove: fix reacquiring global lock after prompt 2019-11-26 14:34:43 -06:00
lvm-flock.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-globals.c pvscan: disable sleeping and retrying for udev 2019-08-16 14:41:26 -05:00
lvm-globals.h pvscan: disable sleeping and retrying for udev 2019-08-16 14:41:26 -05:00
lvm-maths.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvm-maths.h lib: Move lcm and gcd to lib/misc for wider use. 2016-08-18 14:06:13 +01:00
lvm-percent.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvm-percent.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-signal.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvm-signal.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-string.c Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
lvm-string.h lvm-string: add drop_lvname_suffix 2019-10-21 12:14:15 +02:00
lvm-wrappers.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvm-wrappers.h fix: make udev_get_library_context available also for non-udev compilations 2016-04-01 15:35:22 +02:00
sharedlib.c lvm: drop usage of dl library 2018-12-17 10:36:52 +01:00
sharedlib.h lvm: drop usage of dl library 2018-12-17 10:36:52 +01:00
util.h utils: add clzll 2018-06-22 23:37:02 +02:00