[pve-devel] [PATCH] Add useful examples to lvm/lvmthin section.

Wolfgang Link w.link at proxmox.com
Wed Jun 29 09:51:52 CEST 2016


---
 pve-storage-lvm.adoc     | 33 +++++++++++++++++++++++++++++++++
 pve-storage-lvmthin.adoc | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)

diff --git a/pve-storage-lvm.adoc b/pve-storage-lvm.adoc
index 4046e15..521cb02 100644
--- a/pve-storage-lvm.adoc
+++ b/pve-storage-lvm.adoc
@@ -84,6 +84,39 @@ List available volume groups:
 
  # pvesm lvmscan
 
+Storage Layout
+~~~~~~~~~~~~~~
+
+On a default installation {pve} will use lvm.
+
+The layout looks like followed.
+
+.Default LVM Layout.
+[width="100%",options="header"]
+|==============================================================================
+|VG  |LV	   |Mountpoint		|Note
+|pve |swap	   |			|will used as swap partition
+|pve |root	   |/			|
+|pve |data	   |/var/lib/vz/	|{pve} < 4.2
+|pve |data	   |			|{pve} >= 4.2
+|==============================================================================
+
+In {pve} 4.2 we changed the LV data to a thin pool to provide snapshots and native performance of the disk.
+The /var/lib/vz is now included in the LV root.
+
+Create a Volume Group
+~~~~~~~~~~~~~~~~~~~~~
+
+Let's assume we have a empty disk /dev/sdb, where we want to make a Volume Group named vmdata.
+
+First create a partition.
+
+ # sgdisk -N 1 /dev/sdb
+
+ #pvcreate --metadatasize 250k -y -ff /dev/sdb1
+
+ #vgcreate vmdata /dev/sdb1
+
 ifdef::wiki[]
 
 See Also
diff --git a/pve-storage-lvmthin.adoc b/pve-storage-lvmthin.adoc
index 23a72ea..fa3a572 100644
--- a/pve-storage-lvmthin.adoc
+++ b/pve-storage-lvmthin.adoc
@@ -76,6 +76,46 @@ List available LVM thin pools on volume group `pve`:
 
  # pvesm lvmthinscan pve
 
+Create a extra LV for /var/lib/vz
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This can be easily done by create an new thin LV.
+It is thin provision.
+
+ # lvcreate -n <Name> -V <Size[M,G,T]> <VG>/<LVThin_pool>
+
+A real world example it looks like
+
+ # lvcreate -n vz -V 10G pve/data
+
+Now a filesystem must be create on the LV.
+
+ # mkfs.ext4 /dev/data/vz
+
+And at last step this have to be mounted.
+
+WARNING: be sure that /var/lib/vz is empty. On a default installation it isn't.
+
+To make it always accessible add the following line at '/etc/fstab'.
+
+ # echo '/dev/pve/vz /var/lib/vz ext4 defaults 0 2' >> /etc/fstab
+
+Resize metadata pool
+~~~~~~~~~~~~~~~~~~~~
+
+CAUTION: If the pool will extend, then it is be necessary to extent also the metadata pool.
+
+It can be achieved with the following command.
+
+ # lvresize --poolmetadatasize +<size[M,G]> <VG>/<LVThin_pool>
+
+Create a LVM-Thin pool
+~~~~~~~~~~~~~~~~~~~~~~
+A Thinpool will create on top of a Volume Group.
+How create a Volume Group see LVM.
+
+ # lvcreate -L 80G -T -n vmstore vmdata
+
 ifdef::wiki[]
 
 See Also
-- 
2.1.4




More information about the pve-devel mailing list