Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=31f10a0554412269…
Commit: 31f10a05544122693143da75bb4a4857cb890226
Parent: 97b16ec26f10f98b7febf661ba33bcd2882c7e6c
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Oct 6 16:12:51 2014 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Oct 6 16:22:54 2014 -0500
man: lvmcache mention automatic pool conversion
When converting an origin to a cache lv, lvm will automatically convert
the specified cache pool into a cache pool if it is not already a cache
pool.
---
man/lvmcache.7.in | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/man/lvmcache.7.in b/man/lvmcache.7.in
index 2603e1a..79ceb64 100644
--- a/man/lvmcache.7.in
+++ b/man/lvmcache.7.in
@@ -276,6 +276,7 @@ the same VG.
.br
.B lvconvert --type cache\-pool VG/CacheDataLV
+
.SS Create a new cache LV without an existing origin LV
\&
@@ -286,7 +287,7 @@ single step.
.B lvcreate \-\-type cache \-L LargeSize \-n CacheLV
.RS
-.B \-\-cachepool VG/CachePoolLV SlowPVs
+.B \-\-cachepool VG/CachePoolLV VG SlowPVs
.RE
@@ -301,6 +302,32 @@ LV, a cache metadata LV, and combines the two into a cache pool LV.
.B lvcreate \-\-type cache\-pool \-L CacheSize \-n CachePoolLV VG FastPVs
+.SS Convert existing LVs to cache types
+
+\&
+
+When an existing origin LV is converted to a cache LV, the specified cache
+pool may be a normal LV, rather than a cache pool LV. In this case, lvm
+will first convert the normal LV to a cache pool LV. A pool metadata LV
+may optionally be specified.
+
+.B lvcreate -n OriginLV -L LargeSize VG
+.br
+.B lvcreate -n CacheDataLV -L CacheSize VG
+.br
+.B lvconvert --type cache --cachepool VG/CataDataLV VG/OriginLV
+
+This is equivalent to:
+
+.B lvcreate -n OriginLV -L LargeSize VG
+.br
+.B lvcreate -n CacheDataLV -L CacheSize VG
+.br
+.B lvconvert --type cache-pool VG/CacheDataLV
+.br
+.B lvconvert --type cache --cachepool VG/CachePoolLV VG/OriginLV
+
+
.SH SEE ALSO
.BR lvm.conf (5),
.BR lvchange (8),
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b7c81769e72fe6ad…
Commit: b7c81769e72fe6ad4569c10de86090e75fe914ba
Parent: 902192abdc3bc8cf17c89b14db4496476e7fa73c
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Oct 6 14:04:09 2014 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Oct 6 14:04:09 2014 -0500
man: lvmcache changes related to removal and splitting
---
man/lvmcache.7.in | 37 +++++++++++++++++++------------------
1 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/man/lvmcache.7.in b/man/lvmcache.7.in
index 6339b91..2603e1a 100644
--- a/man/lvmcache.7.in
+++ b/man/lvmcache.7.in
@@ -138,15 +138,30 @@ OriginLV is renamed OriginLV_corig and becomes hidden.
.SH Cache Removal
+.SS Split a cache pool LV off of a cache LV
+
+\&
+
+A cache pool LV can be disconnected from a cache LV, leaving an
+unused cache pool LV, and an uncached origin LV. This command
+writes back data from the cache pool to the origin LV when necessary.
+
+.B lvconvert --splitcache VG/CacheLV
+
.SS Removing a cache pool LV without removing its linked origin LV
\&
This writes back data from the cache pool to the origin LV when necessary,
-then removes the cache pool LV, leaving the un-cached origin LV.
+then removes the cache pool LV, leaving the uncached origin LV.
.B lvremove VG/CachePoolLV
+An alternative command that also disconnects the cache pool from the cache
+LV, and deletes the cache pool:
+
+.B lvconvert --uncache VG/CacheLV
+
.I Example
.nf
# lvs vg
@@ -161,29 +176,15 @@ then removes the cache pool LV, leaving the un-cached origin LV.
lvol0 vg -wi-a----- 100.00g
.fi
-.SS Removing an origin LV without removing its linked cache pool LV
+.SS Removing a cache LV: both origin LV and the cache pool LV
\&
-This removes the origin LV, leaving the cache pool LV which can be linked
-to another origin LV.
+Removing a cache LV removes both the origin LV and the linked cache pool
+LV.
.B lvremove VG/CacheLV
-.I Example
-.nf
-# lvs vg
- LV VG Attr LSize Pool Origin
- cache0 vg Cwi---C--- 10.00g
- lvol0 vg Cwi-a-C--- 100.00g cache0 [lvol0_corig]
-
-# lvremove vg/lvol0
-
-# lvs vg
- LV VG Attr LSize Pool Origin
- cache0 vg Cwi---C--- 10.00g
-.fi
-
.SH Cache Topics
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=902192abdc3bc8cf…
Commit: 902192abdc3bc8cf17c89b14db4496476e7fa73c
Parent: 1115a9ea51a3302ede188073f94a42f4b38867da
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Oct 6 13:29:18 2014 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Oct 6 13:29:18 2014 -0500
man: lvmthin show the lvcreate -n option for pools
lvcreate of thin pools can now use '-n lv vg' like other lv types,
or it can name the new thin pool in the free arg as 'vg/lv', which
is not allowed with other lv types.
---
man/lvmthin.7.in | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/man/lvmthin.7.in b/man/lvmthin.7.in
index 8009a9e..84a3138 100644
--- a/man/lvmthin.7.in
+++ b/man/lvmthin.7.in
@@ -989,16 +989,12 @@ rather than using lvconvert on existing LVs.
This one command creates a thin data LV, a thin metadata LV,
and combines the two into a thin pool LV.
-.B lvcreate \-\-type thin\-pool \-L LargeSize VG/ThinPoolLV
-
-./" FIXME: make this work
-./" or using standard form of lvcreate:
-./" .B lvcreate \-\-type thin\-pool \-L LargeSize \-n ThinPoolLV VG
+.B lvcreate \-\-type thin\-pool \-L LargeSize \-n ThinPoolLV VG
.I Example
.br
.nf
-# lvcreate \-\-type thin\-pool \-L8M vg/pool0
+# lvcreate \-\-type thin\-pool \-L8M -n pool0 vg
# lvs vg/pool0
LV VG Attr LSize Pool Origin Data%
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fa517221a19751b9…
Commit: fa517221a19751b93a5b94f8b379919b9c1c0226
Parent: 742d250cc52dcbd965310b1bf5357d4793254f4d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 6 15:30:19 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 6 15:31:44 2014 +0200
tests: lvconvert cache usage of thin pool
Checked stacking usage of thin pool data volume being cached.
---
test/shell/lvconvert-cache-thin.sh | 50 ++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-cache-thin.sh b/test/shell/lvconvert-cache-thin.sh
new file mode 100644
index 0000000..87256a4
--- /dev/null
+++ b/test/shell/lvconvert-cache-thin.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Exercise usage of stacked cache volume used in thin pool volumes
+
+. lib/inittest
+
+aux have_cache 1 3 0 || skip
+aux have_thin 1 0 0 || skip
+
+aux prepare_vg 5 80
+
+lvcreate -L10 -n cpool $vg
+lvcreate -L10 -n tpool $vg
+lvcreate -L10 -n $lv1 $vg
+
+lvconvert --yes --cache --cachepool cpool $vg/tpool
+
+# Currently the only allowed stacking is cache thin data volume
+lvconvert --yes --type thin-pool $vg/tpool
+
+lvcreate -V10 -T -n $lv2 $vg/tpool
+
+aux mkdev_md5sum $vg $lv2
+
+lvconvert --splitcache $vg/tpool
+
+check dev_md5sum $vg $lv2
+lvchange -an $vg
+lvchange -ay $vg
+check dev_md5sum $vg $lv2
+
+lvs -a $vg
+lvconvert --yes --cache --cachepool cpool $vg/tpool
+
+lvconvert --yes -T --thinpool $vg/tpool $vg/$lv1
+check lv_field $vg/tpool segtype "thin-pool"
+check lv_field $vg/$lv1 segtype "thin"
+lvconvert --uncache $vg/tpool
+lvs -a $vg
+
+vgremove -f $vg