1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
LVM2 mirror repository https://sourceware.org/lvm2/
Go to file
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
autoconf autoconf: Fix py-compile permissions 2016-02-18 01:05:05 +00:00
base cov: mark warning as expected one 2018-11-03 16:10:32 +01:00
conf build: make genrate config file 2018-10-11 11:06:23 +02:00
coverity coverity: model few more functions 2017-06-27 12:17:16 +02:00
daemons debug: tracing fclose failure 2018-11-05 17:25:11 +01:00
device_mapper Allow dm-cache cache device to be standard LV 2018-11-06 13:44:54 -06:00
doc Merge branch 'master' into 2018-05-11-fork-libdm 2018-06-01 13:04:12 +01:00
include build: Update configure 2018-09-14 13:53:29 +02:00
lib Allow dm-cache cache device to be standard LV 2018-11-06 13:44:54 -06:00
libdaemon device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
libdm cleanup: move cast to det_t into MKDEV macro 2018-11-05 17:25:11 +01:00
man build: make generate 2018-10-10 11:25:50 +02:00
nix lockd: Clean up spec 2015-07-04 14:36:57 +02:00
po doc: change fsf address 2016-01-21 12:11:37 +01:00
scripts cov: explicit ignore if failures 2018-11-03 16:09:36 +01:00
spec spec: lvmdbusd requires python3 setuptools 2018-10-22 12:51:51 +02:00
test Allow dm-cache cache device to be standard LV 2018-11-06 13:44:54 -06:00
tools Allow dm-cache cache device to be standard LV 2018-11-06 13:44:54 -06:00
udev udev: keep systemd vars on change event in 69-dm-lvm-metad.rules for systemd reload 2018-04-17 11:38:12 +02:00
.gitignore gitignore 2018-05-23 16:53:18 +02:00
acinclude.m4 [build] uncomment 'serial 3' in an m4 file. 2018-04-30 09:44:27 +01:00
aclocal.m4 liblvm: remove lvmapi 2018-06-08 09:38:05 +01:00
configure build: Fix CLDFLAGS default 2018-10-30 10:15:44 +01:00
configure.ac build: Fix CLDFLAGS default 2018-10-30 10:15:44 +01:00
COPYING doc: change fsf address 2016-01-21 12:11:37 +01:00
COPYING.BSD Add BSD 2-Clause License 2018-07-27 17:09:46 +02:00
COPYING.LIB Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
INSTALL quick review of docs 2008-11-04 17:49:22 +00:00
make.tmpl.in build: add vdo configuration option --with-vdo= 2018-07-09 15:28:35 +02:00
Makefile.in Remove lvmetad 2018-07-11 11:26:42 -05:00
README pre-release 2018-10-10 11:26:53 +02:00
TESTING docs: Add TESTING file 2017-12-14 16:45:47 +01:00
VERSION post-release 2018-10-31 15:56:41 +01:00
VERSION_DM post-release 2018-10-31 15:56:41 +01:00
WHATS_NEW post-release 2018-10-31 15:56:41 +01:00
WHATS_NEW_DM post-release 2018-10-31 15:56:41 +01:00

This tree contains the LVM2 and device-mapper tools and libraries.

This is development branch, for stable 2.02 release see 2018-06-01-stable
branch.

For more information about LVM2 read the changelog in the WHATS_NEW file.
Installation instructions are in INSTALL.

There is no warranty - see COPYING and COPYING.LIB.

Tarballs are available from:
  ftp://sourceware.org/pub/lvm2/
  ftp://sources.redhat.com/pub/lvm2/
  https://github.com/lvmteam/lvm2/releases

The source code is stored in git:
  https://sourceware.org/git/?p=lvm2.git
  git clone git://sourceware.org/git/lvm2.git
mirrored to:
  https://github.com/lvmteam/lvm2
  git clone https://github.com/lvmteam/lvm2.git
  git clone git@github.com:lvmteam/lvm2.git

Mailing list for general discussion related to LVM2:
  linux-lvm@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

Mailing lists for LVM2 development, patches and commits:
  lvm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/lvm-devel

  lvm2-commits@lists.fedorahosted.org (Read-only archive of commits)
  Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits

Mailing list for device-mapper development, including kernel patches
and multipath-tools:
  dm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel

Website:
  https://sourceware.org/lvm2/

Report upstream bugs at:
  https://bugzilla.redhat.com/enter_bug.cgi?product=LVM%20and%20device-mapper
or open issues at:
  https://github.com/lvmteam/lvm2/issues

The source code repository used until 7th June 2012 is accessible here:
  http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/?cvsroot=lvm2.