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

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Oct 7 11:10:23 CEST 2016


comments (and solution) regarding the PDF problem inline, might be
helpful when rebasing/moving the content.

On Thu, Oct 06, 2016 at 12:07:31PM +0200, Wolfgang Link wrote:
> How to manage it.
> ---
>  pve-storage-lvm.adoc     | 38 ++++++++++++++++++++++++++++++++++++++
>  pve-storage-lvmthin.adoc | 43 +++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 81 insertions(+)
> 
> diff --git a/pve-storage-lvm.adoc b/pve-storage-lvm.adoc
> index 3f21644..18f2810 100644
> --- a/pve-storage-lvm.adoc
> +++ b/pve-storage-lvm.adoc
> @@ -85,6 +85,44 @@ List available volume groups:
>  
>   # pvesm lvmscan
>  
> +
> +Storage Layout
> +~~~~~~~~~~~~~~
> +
> +On a default installation {pve} will use lvm.
> +
> +The layout looks as follows.
> +
> +.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 installed
> +|pve |data	   |			|{pve} >= 4.2 installed
> +|==============================================================================
> +
> +For {pve} versions up to 4.1, the installer creates a Logical Volume
> +called 'data' which is mounted at /var/lib/vz
> +Starting from 4.2 the Logical Volume 'data' is a LVM thin volume, used
> +for block based storage of guest systems, and /var/lib/vz is simply a
> +directory on the root file system.
> +
> +
> +Creating a Volume Group
> +~~~~~~~~~~~~~~~~~~~~~
> +
> +Let's assume we have an empty disk /dev/sdb, onto which 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 be730cf..8f1e378 100644
> --- a/pve-storage-lvmthin.adoc
> +++ b/pve-storage-lvmthin.adoc
> @@ -76,6 +76,49 @@ List available LVM thin pools on volume group `pve`:
>  
>   # pvesm lvmthinscan pve
>  
> +
> +Creating an extra LV for /var/lib/vz
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                    ^^^
although well-hidden by the error messages/asciidoc, the actual root
cause is here. adding the missing three '~' solves the problem.

> +
> +This can be easily done by create a new thin LV.
> +
> + #lvcreate -n <Name> -V <Size[M,G,T]> <VG>/<LVThin_pool>`
> +

this has an extra '`' at the end, and is missing a space after the #

> +A real world example might look.
> +
> + # 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's not.
> +
> +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
> +
> +
> +Resizing the thin pool
> +~~~~~~~~~~~~~~~~~~~~~~
> +
> +NOTE: When extending the data pool, the metadata pool must be extended with it.
> +
> +Resize the LV and the metadata pool can be achieved with the following command.
> +
> + # lvresize --size +<size[\M,G,T]> --poolmetadatasize +<size[\M,G]> <VG>/<LVThin_pool>`
> +

this has an extra '`' at the end, as well as two back slashes that are
not needed.

> +
> +Create a LVM-Thin pool
> +~~~~~~~~~~~~~~~~~~~~~~
> +
> +A thin pool has to be created on top of a volume group.
> +How to create a Volume Group see Section LVM.
> +
> + # lvcreate -L 80G -T -n vmstore vmdata
> +
>  ifdef::wiki[]
>  
>  See Also
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list