1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

man: lvmthin cover snapshot merge and xfs

also fix a couple inconsistent example values.
This commit is contained in:
David Teigland 2014-05-14 14:05:21 -05:00
parent 044b796800
commit 42d7409da2

View File

@ -104,7 +104,7 @@ The primary method for using lvm thin provisioning:
lvcreate -n ThinDataLV -L LargeSize VG lvcreate -n ThinDataLV -L LargeSize VG
Example Example
# lvcreate -n pool0 -L 100G vg # lvcreate -n pool0 -L 10G vg
2. create ThinMetaLV 2. create ThinMetaLV
@ -251,6 +251,10 @@ Single step thin pool LV creation
.br .br
Single step thin pool LV and thin LV creation Single step thin pool LV and thin LV creation
.br .br
Merge thin snapshots
.br
XFS on snapshots
.br
\& \&
@ -269,7 +273,7 @@ lvcreate -n ThinMetaLV -L SmallSize VG SmallPV
lvconvert --thinpool VG/ThinDataLV --poolmetadata VG/ThinMetaLV lvconvert --thinpool VG/ThinDataLV --poolmetadata VG/ThinMetaLV
Example Example
# lvcreate -n pool0 -L 100G vg /dev/sdA # lvcreate -n pool0 -L 10G vg /dev/sdA
# lvcreate -n pool0meta -L 1G vg /dev/sdB # lvcreate -n pool0meta -L 1G vg /dev/sdB
# lvconvert --thinpool vg/pool0 --poolmetadata vg/pool0meta # lvconvert --thinpool vg/pool0 --poolmetadata vg/pool0meta
.fi .fi
@ -293,7 +297,7 @@ lvcreate --type raid1 -m 1 -n ThinDataLV -L LargeSize VG PVC PVD
lvconvert --thinpool VG/ThinDataLV --poolmetadata VG/ThinMetaLV lvconvert --thinpool VG/ThinDataLV --poolmetadata VG/ThinMetaLV
Example Example
# lvcreate --type raid1 -m 1 -n pool0 -L 100G vg /dev/sdA /dev/sdB # lvcreate --type raid1 -m 1 -n pool0 -L 10G vg /dev/sdA /dev/sdB
# lvcreate --type raid1 -m 1 -n pool0meta -L 1G vg /dev/sdC /dev/sdD # lvcreate --type raid1 -m 1 -n pool0meta -L 1G vg /dev/sdC /dev/sdD
# lvconvert --thinpool vg/pool0 --poolmetadata vg/pool0meta # lvconvert --thinpool vg/pool0 --poolmetadata vg/pool0meta
.fi .fi
@ -981,6 +985,111 @@ pool0 vg twi-a-tz-- 8.00m
thin1 vg Vwi-a-tz-- 2.00g pool0 thin1 vg Vwi-a-tz-- 2.00g pool0
.fi .fi
.SS Merge thin snapshots
\&
A thin snapshot can be merged into its origin thin LV using the lvconvert
--merge command. The result of a snapshot merge is that the origin thin
LV takes the content of the snapshot LV, and the snapshot LV is removed.
Any content that was unique to the origin thin LV is lost after the merge.
Because a merge changes the content of an LV, it cannot be done while the
LVs are open, e.g. mounted. If a merge is initiated while the LVs are open,
the effect of the merge is delayed until the origin thin LV is next
activated.
.nf
lvconvert --merge VG/SnapLV
Example
# lvs vg
LV VG Attr LSize Pool Origin
pool0 vg twi-a-tz-- 10.00g
thin1 vg Vwi-a-tz-- 100.00g pool0
thin1s1 vg Vwi-a-tz-k 100.00g pool0 thin1
# lvconvert --merge vg/thin1s1
# lvs vg
LV VG Attr LSize Pool Origin
pool0 vg twi-a-tz-- 10.00g
thin1 vg Vwi-a-tz-- 100.00g pool0
.fi
.nf
Example
Delayed merging of open LVs.
# lvs vg
LV VG Attr LSize Pool Origin
pool0 vg twi-a-tz-- 10.00g
thin1 vg Vwi-aotz-- 100.00g pool0
thin1s1 vg Vwi-aotz-k 100.00g pool0 thin1
# df
/dev/mapper/vg-thin1 100G 33M 100G 1% /mnt/X
/dev/mapper/vg-thin1s1 100G 33M 100G 1% /mnt/Xs
# ls /mnt/X
file1 file2 file3
# ls /mnt/Xs
file3 file4 file5
# lvconvert --merge vg/thin1s1
Logical volume vg/thin1s1 contains a filesystem in use.
Delaying merge since snapshot is open.
Merging of thin snapshot thin1s1 will occur on next activation.
# umount /mnt/X
# umount /mnt/Xs
# lvs -a vg
LV VG Attr LSize Pool Origin
pool0 vg twi-a-tz-- 10.00g
[pool0_tdata] vg Twi-ao---- 10.00g
[pool0_tmeta] vg ewi-ao---- 1.00g
thin1 vg Owi-a-tz-- 100.00g pool0
[thin1s1] vg Swi-a-tz-k 100.00g pool0 thin1
# lvchange -an vg/thin1
# lvchange -ay vg/thin1
# mount /dev/vg/thin1 /mnt/X
# ls /mnt/X
file3 file4 file5
.fi
.SS XFS on snapshots
\&
Mounting an XFS file system on a new snapshot LV requires attention to the
file system's log state and uuid. On the snapshot LV, the xfs log will
contain a dummy transaction, and the xfs uuid will match the uuid from the
file system on the origin LV.
If the snapshot LV is writable, mounting will recover the log to clear the
dummy transaction, but will require skipping the uuid check:
mount /dev/VG/SnapLV /mnt -o nouuid
Or, the uuid can be changed on disk before mounting:
xfs_admin -U generate /dev/VG/SnapLV
.br
mount /dev/VG/SnapLV /mnt
If the snapshot LV is readonly, the log recovery and uuid check need to be
skipped while mounting readonly:
mount /dev/VG/SnapLV /mnt -o ro,nouuid,norecovery
.SH SEE ALSO .SH SEE ALSO
.BR lvm (8), .BR lvm (8),
.BR lvm.conf (5), .BR lvm.conf (5),