1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
David Teigland cac4a9743a Allow dm-cache cache device to be standard LV
If a single, standard LV is specified as the cache, use
it directly instead of converting it into a cache-pool
object with two separate LVs (for data and metadata).

With a single LV as the cache, lvm will use blocks at the
beginning for metadata, and the rest for data.  Separate
dm linear devices are set up to point at the metadata and
data areas of the LV.  These dm devs are given to the
dm-cache target to use.

The single LV cache cannot be resized without recreating it.

If the --poolmetadata option is used to specify an LV for
metadata, then a cache pool will be created (with separate
LVs for data and metadata.)

Usage:

$ lvcreate -n main -L 128M vg /dev/loop0

$ lvcreate -n fast -L 64M vg /dev/loop1

$ lvs -a vg
  LV   VG Attr       LSize   Type   Devices
  main vg -wi-a----- 128.00m linear /dev/loop0(0)
  fast vg -wi-a-----  64.00m linear /dev/loop1(0)

$ lvconvert --type cache --cachepool fast vg/main

$ lvs -a vg
  LV           VG Attr       LSize   Origin       Pool  Type   Devices
  [fast]       vg Cwi---C---  64.00m                     linear /dev/loop1(0)
  main         vg Cwi---C--- 128.00m [main_corig] [fast] cache  main_corig(0)
  [main_corig] vg owi---C--- 128.00m                     linear /dev/loop0(0)

$ lvchange -ay vg/main

$ dmsetup ls
vg-fast_cdata   (253:4)
vg-fast_cmeta   (253:5)
vg-main_corig   (253:6)
vg-main (253:24)
vg-fast (253:3)

$ dmsetup table
vg-fast_cdata: 0 98304 linear 253:3 32768
vg-fast_cmeta: 0 32768 linear 253:3 0
vg-main_corig: 0 262144 linear 7:0 2048
vg-main: 0 262144 cache 253:5 253:4 253:6 128 2 metadata2 writethrough mq 0
vg-fast: 0 131072 linear 7:1 2048

$ lvchange -an vg/min

$ lvconvert --splitcache vg/main

$ lvs -a vg
  LV   VG Attr       LSize   Type   Devices
  fast vg -wi-------  64.00m linear /dev/loop1(0)
  main vg -wi------- 128.00m linear /dev/loop0(0)
2018-11-06 13:44:54 -06:00
..
activate Allow dm-cache cache device to be standard LV 2018-11-06 13:44:54 -06:00
cache debug: missing backtrace 2018-11-05 17:25:11 +01:00
cache_segtype Allow dm-cache cache device to be standard LV 2018-11-06 13:44:54 -06:00
commands cov: fix failing filter initialization 2018-10-15 17:49:44 +02:00
config config: Fix version for VDO 2018-10-11 11:06:23 +02:00
datastruct build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
device debug: missing backtrace 2018-11-05 17:25:11 +01:00
display display: basic vdo segment lvdisplay and lvs support 2018-07-09 15:28:35 +02:00
error device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
filters cov: avoid selfrecursive inclusion of toolcontext.h 2018-10-15 17:49:44 +02:00
format_text Allow dm-cache cache device to be standard LV 2018-11-06 13:44:54 -06:00
freeseg device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
label cov: avoid unsing unchecked label_scan_open 2018-11-05 17:25:11 +01:00
locking Allow dm-cache cache device to be standard LV 2018-11-06 13:44:54 -06:00
log device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
lvmpolld device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
metadata Allow dm-cache cache device to be standard LV 2018-11-06 13:44:54 -06:00
mirror cov: drop uneeded header files 2018-10-15 17:49:44 +02:00
misc vdo: component activation of VDO data LV 2018-07-09 15:28:35 +02:00
mm memlock: extend exception list 2018-07-02 10:24:20 +02:00
notify build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
properties build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
raid Merge branch '2018-06-04-data-structs' 2018-06-08 14:21:07 +01:00
report Allow dm-cache cache device to be standard LV 2018-11-06 13:44:54 -06:00
snapshot Merge branch '2018-06-04-data-structs' 2018-06-08 14:21:07 +01:00
striped device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
thin Merge branch '2018-06-04-data-structs' 2018-06-08 14:21:07 +01:00
unknown device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
uuid build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
vdo dmeventd: lvm vdo support 2018-07-09 15:29:16 +02:00
zero device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
Makefile.in Remove lvmetad 2018-07-11 11:26:42 -05:00