1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

man: update lvmthin

Improve graphics form of page and use shorter correct and suggested
forms of thin pool manipulation commands.
This commit is contained in:
Zdenek Kabelac 2014-06-10 23:58:45 +02:00
parent e156837636
commit d13efac51b

View File

@ -95,54 +95,55 @@ appears as a snapshot of another LV after creation
The primary method for using lvm thin provisioning: The primary method for using lvm thin provisioning:
.nf .SS 1. create ThinDataLV
1. create ThinDataLV
Create an LV that will hold thin pool data. Create an LV that will hold thin pool data.
Command .B lvcreate \-n ThinDataLV \-L LargeSize VG
lvcreate \-n ThinDataLV \-L LargeSize VG
Example .I Example
# lvcreate \-n pool0 \-L 10G vg .br
.B # lvcreate \-n pool0 \-L 10G vg
2. create ThinMetaLV .SS 2. create ThinMetaLV
Create an LV that will hold thin pool metadata. Create an LV that will hold thin pool metadata.
Command .B lvcreate \-n ThinMetaLV \-L SmallSize VG
lvcreate \-n ThinMetaLV \-L SmallSize VG
Example .I Example
# lvcreate \-n pool0meta \-L 1G vg .br
.B # lvcreate \-n pool0meta \-L 1G vg
# lvs # lvs
LV VG Attr LSize
pool0 vg -wi-a----- 10.00g pool0 vg -wi-a----- 10.00g
pool0meta vg -wi-a----- 1.00g pool0meta vg -wi-a----- 1.00g
3. create ThinPoolLV .SS 3. create ThinPoolLV
Combine the data and metadata LVs into a thin pool LV. Combine the data and metadata LVs into a thin pool LV.
ThinDataLV is renamed to hidden ThinPoolLV_tdata. ThinDataLV is renamed to hidden ThinPoolLV_tdata.
ThinMetaLV is renamed to hidden ThinPoolLV_tmeta. ThinMetaLV is renamed to hidden ThinPoolLV_tmeta.
The new ThinPoolLV takes the previous name of ThinDataLV. The new ThinPoolLV takes the previous name of ThinDataLV.
Command .B lvconvert \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV
lvconvert \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV
Example .I Example
# lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta .br
.B # lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta
# lvs vg/pool0 # lvs vg/pool0
LV VG Attr LSize Pool Origin Data% LV VG Attr LSize Pool Origin Data% Meta%
pool0 vg twi-a-tz-- 10.00g 0.00 pool0 vg twi-a-tz-- 10.00g 0.00 0.00
# lvs -a # lvs \-a
LV VG Attr LSize
pool0 vg twi-a-tz-- 10.00g pool0 vg twi-a-tz-- 10.00g
[pool0_tdata] vg Twi-ao---- 10.00g [pool0_tdata] vg Twi-ao---- 10.00g
[pool0_tmeta] vg ewi-ao---- 1.00g [pool0_tmeta] vg ewi-ao---- 1.00g
4. create ThinLV .SS 4. create ThinLV
Create a new thin LV from the thin pool LV. Create a new thin LV from the thin pool LV.
The thin LV is created with a virtual size. The thin LV is created with a virtual size.
@ -151,38 +152,49 @@ The primary method for using lvm thin provisioning:
The thinpool argument specifies which thin pool will The thinpool argument specifies which thin pool will
contain the ThinLV. contain the ThinLV.
Command .B lvcreate \-n ThinLV \-V VirtualSize \-\-thinpool VG/ThinPoolLV
lvcreate \-\-type thin \-n ThinLV \-V VirtualSize \-\-thinpool VG/ThinPoolLV .br
.B lvcreate \-T \-n ThinLV \-V VirtualSize VG/ThinPoolLV
Example .I Example
.br
Create a thin LV in a thin pool: Create a thin LV in a thin pool:
# lvcreate \-\-type thin \-n thin1 \-V 1T \-\-thinpool vg/pool0 .br
.B # lvcreate \-T \-n thin1 \-V 1T vg/pool0
Create another thin LV in the same thin pool: Create another thin LV in the same thin pool:
# lvcreate \-\-type thin \-n thin2 \-V 1T \-\-thinpool vg/pool0 .br
.B # lvcreate \-n thin2 \-V 1T \-\-thinpool vg/pool0
# lvs vg/thin1 vg/thin2 # lvs vg/thin1 vg/thin2
LV VG Attr LSize Pool Origin Data% LV VG Attr LSize Pool Origin Data%
thin1 vg Vwi-a-tz-- 1.00t pool0 0.00 thin1 vg Vwi-a-tz-- 1.00t pool0 0.00
thin2 vg Vwi-a-tz-- 1.00t pool0 0.00 thin2 vg Vwi-a-tz-- 1.00t pool0 0.00
5. create SnapLV .SS 5. create SnapLV
Create snapshots of an existing ThinLV or SnapLV. Create snapshots of an existing ThinLV or SnapLV.
Do not \fBNOT\fP specify
.BR \-L ", " \-\-size
since this would not create thin snapshot, but old COW volume.
Command .B lvcreate \-n SnapLV \-s VG/ThinLV
lvcreate \-\-type thin \-n SnapLV \-s ThinLV \-\-thinpool VG/ThinPoolLV .br
lvcreate \-\-type thin \-n SnapLV \-s PrevSnapLV \-\-thinpool VG/ThinPoolLV .B lvcreate \-n SnapLV \-s VG/PrevSnapLV
Example .I Example
.br
Create first snapshot of an existing ThinLV: Create first snapshot of an existing ThinLV:
# lvcreate \-\-type thin \-n thin1s1 \-s thin1 \-\-thinpool vg/pool0 .br
.B # lvcreate \-n thin1s1 \-s vg/thin1
Create second snapshot of the same ThinLV: Create second snapshot of the same ThinLV:
# lvcreate \-\-type thin \-n thin1s2 \-s thin1 \-\-thinpool vg/pool0 .br
.B # lvcreate \-n thin1s2 \-s vg/thin1
Create a snapshot of the first snapshot: Create a snapshot of the first snapshot:
# lvcreate \-\-type thin \-n thin1s1s1 \-s thin1s1 \-\-thinpool vg/pool0 .br
.B # lvcreate \-n thin1s1s1 \-s vg/thin1s1
# lvs vg/thin1s1 vg/thin1s2 vg/thin1s1s1 # lvs vg/thin1s1 vg/thin1s2 vg/thin1s1s1
LV VG Attr LSize Pool Origin LV VG Attr LSize Pool Origin
@ -190,71 +202,70 @@ The primary method for using lvm thin provisioning:
thin1s2 vg Vwi---tz-k 1.00t pool0 thin1 thin1s2 vg Vwi---tz-k 1.00t pool0 thin1
thin1s1s1 vg Vwi---tz-k 1.00t pool0 thin1s1 thin1s1s1 vg Vwi---tz-k 1.00t pool0 thin1s1
6. activate SnapLV
.SS 6. activate SnapLV
Thin snapshots are created with the persistent "activation skip" Thin snapshots are created with the persistent "activation skip"
flag, indicated by the "k" attribute. Use \-K with lvchange flag, indicated by the "k" attribute. Use \-K with lvchange
or vgchange to activate thin snapshots with the "k" attribute. or vgchange to activate thin snapshots with the "k" attribute.
Command .B lvchange \-ay \-K VG/SnapLV
lvchange \-ay \-K VG/SnapLV
Example .I Example
# lvchange \-ay \-K vg/thin1s1 .br
.B # lvchange \-ay \-K vg/thin1s1
# lvs vg/thin1s1 # lvs vg/thin1s1
LV VG Attr LSize Pool Origin
thin1s1 vg Vwi-a-tz-k 1.00t pool0 thin1 thin1s1 vg Vwi-a-tz-k 1.00t pool0 thin1
.fi
.SH Thin Topics .SH Thin Topics
Specify devices for data and metadata LVs .B Specify devices for data and metadata LVs
.br .br
Tolerate device failures using raid .B Tolerate device failures using raid
.br .br
Spare metadata LV .B Spare metadata LV
.br .br
Metadata check and repair .B Metadata check and repair
.br .br
Automatic pool metadata LV .B Automatic pool metadata LV
.br .br
Activation of thin snapshots .B Activation of thin snapshots
.br .br
Removing thin pool LVs, thin LVs and snapshots .B Removing thin pool LVs, thin LVs and snapshots
.br .br
Manually manage free data space of thin pool LV .B Manually manage free data space of thin pool LV
.br .br
Manually manage free metadata space of a thin pool LV .B Manually manage free metadata space of a thin pool LV
.br .br
Using fstrim to increase free space in a thin pool LV .B Using fstrim to increase free space in a thin pool LV
.br .br
Automatically extend thin pool LV .B Automatically extend thin pool LV
.br .br
Data space exhaustion .B Data space exhaustion
.br .br
Metadata space exhaustion .B Metadata space exhaustion
.br .br
Zeroing .B Zeroing
.br .br
Discard .B Discard
.br .br
Chunk size .B Chunk size
.br .br
Size of pool metadata LV .B Size of pool metadata LV
.br .br
Create a thin snapshot of an external, read only LV .B Create a thin snapshot of an external, read only LV
.br .br
Convert a standard LV to a thin LV with an external origin .B Convert a standard LV to a thin LV with an external origin
.br .br
Single step thin pool LV creation .B Single step thin pool LV creation
.br .br
Single step thin pool LV and thin LV creation .B Single step thin pool LV and thin LV creation
.br .br
Merge thin snapshots .B Merge thin snapshots
.br
XFS on snapshots
.br .br
.B XFS on snapshots
\& \&
@ -267,22 +278,26 @@ separate physical devices. To do that, specify the device name(s)
at the end of the lvcreate line. It can be especially helpful at the end of the lvcreate line. It can be especially helpful
to use fast devices for the metadata LV. to use fast devices for the metadata LV.
.nf .B lvcreate \-n ThinDataLV \-L LargeSize VG LargePV
lvcreate \-n ThinDataLV \-L LargeSize VG LargePV .br
lvcreate \-n ThinMetaLV \-L SmallSize VG SmallPV .B lvcreate \-n ThinMetaLV \-L SmallSize VG SmallPV
lvconvert \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV .br
.B lvconvert \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV
Example .I Example
# lvcreate \-n pool0 \-L 10G vg /dev/sdA .br
# lvcreate \-n pool0meta \-L 1G vg /dev/sdB .B # lvcreate \-n pool0 \-L 10G vg /dev/sdA
# lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta .br
.fi .B # lvcreate \-n pool0meta \-L 1G vg /dev/sdB
.br
.B # lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta
.BR lvm.conf (5) .BR lvm.conf (5)
.B thin_pool_metadata_require_separate_pvs .B thin_pool_metadata_require_separate_pvs
.br .br
controls the default PV usage for thin pool creation. controls the default PV usage for thin pool creation.
\&
.SS Tolerate device failures using raid .SS Tolerate device failures using raid
@ -291,16 +306,19 @@ controls the default PV usage for thin pool creation.
To tolerate device failures, use raid for the pool data LV and To tolerate device failures, use raid for the pool data LV and
pool metadata LV. This is especially recommended for pool metadata LVs. pool metadata LV. This is especially recommended for pool metadata LVs.
.nf .B lvcreate \-\-type raid1 \-m 1 \-n ThinMetaLV \-L SmallSize VG PVA PVB
lvcreate \-\-type raid1 \-m 1 \-n ThinMetaLV \-L SmallSize VG PVA PVB .br
lvcreate \-\-type raid1 \-m 1 \-n ThinDataLV \-L LargeSize VG PVC PVD .B lvcreate \-\-type raid1 \-m 1 \-n ThinDataLV \-L LargeSize VG PVC PVD
lvconvert \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV .br
.B lvconvert \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV
Example .I Example
# lvcreate \-\-type raid1 \-m 1 \-n pool0 \-L 10G vg /dev/sdA /dev/sdB .br
# lvcreate \-\-type raid1 \-m 1 \-n pool0meta \-L 1G vg /dev/sdC /dev/sdD .B # lvcreate \-\-type raid1 \-m 1 \-n pool0 \-L 10G vg /dev/sdA /dev/sdB
# lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta .br
.fi .B # lvcreate \-\-type raid1 \-m 1 \-n pool0meta \-L 1G vg /dev/sdC /dev/sdD
.br
.B # lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta
.SS Spare metadata LV .SS Spare metadata LV