[pve-devel] [PATCH v2 pve-docs] Add useful examples to create/resize a lvm[-thin] pool.

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Oct 12 12:51:59 CEST 2016


comments inline

On Wed, Oct 12, 2016 at 12:07:13PM +0200, Wolfgang Link wrote:
> ---
>  local-lvm.adoc | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 63 insertions(+)
> 
> diff --git a/local-lvm.adoc b/local-lvm.adoc
> index 45e875f..603e23d 100644
> --- a/local-lvm.adoc
> +++ b/local-lvm.adoc
> @@ -41,6 +41,12 @@ data:: This volume uses LVM-thin, and is used to store VM
>  images. LVM-thin is preferable for this task, because it offers
>  efficient support for snapshots and clones.
>  
> +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.
> +
>  Hardware
>  ~~~~~~~~
>  
> @@ -58,3 +64,60 @@ Bootloader
>  We install two boot loaders by default. The first partition contains
>  the standard GRUB boot loader. The second partition is an **E**FI **S**ystem
>  **P**artition (ESP), which makes it possible to boot on EFI systems.
> +
> +
> +Creating a Volume Group
> +~~~~~~~~~~~~~~~~~~~~~

is missing two '~'      ^^

> +
> +Let's assume we have an empty disk /dev/sdb, onto which we want to make a Volume Group named vmdata.

s/make/create/

I'd also prefer `/dev/sdb` and ``vmdata'' for consistency with the rest
of the documentation.

> +
> +First create a partition.
> +
> + # sgdisk -N 1 /dev/sdb
> +
> + #pvcreate --metadatasize 250k -y -ff /dev/sdb1
> +
> + #vgcreate vmdata /dev/sdb1

inconsistent space after '#'
(sidenote: we should probably settle on one way to format such commands
and document it - this is very inconsistent currently)

no description for two of the three commands

> +
> +
> +Creating an extra LV for /var/lib/vz
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +This can be easily done by create a new thin LV.

s/create/creating/

> +
> + # lvcreate -n <Name> -V <Size[M,G,T]> <VG>/<LVThin_pool>
> +
> +A real world example might look.

'look like this:' or just 'A real world example:' ?
> +
> + # lvcreate -n vz -V 10G pve/data
> +
> +Now a filesystem must be create on the LV.
> +

s/create/created/

> + # mkfs.ext4 /dev/data/vz
> +
> +And at last step this have to be mounted.

'at last' or 'as a last step'

s/this have/it has/

> +
> +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'.

s/at/in/

> +
> + # echo '/dev/pve/vz /var/lib/vz ext4 defaults 0 2' >> /etc/fstab
> +
> +

it might make sense to mention the 'is_mountpoint' option for directory
storages here - it prevents activation of the storage unless it is
correctly mounted.

> +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.

s/Resize/Resizing/
s/metadata pool/pool metadata volume/g
s/data pool/pool data volume/g

> +
> + # lvresize --size +<size[\M,G,T]> --poolmetadatasize +<size[\M,G]> <VG>/<LVThin_pool>
> +
> +
> +Create a LVM-Thin pool
> +~~~~~~~~~~~~~~~~~~~~~~

s/pool/Pool/

> +
> +A thin pool has to be created on top of a volume group.
> +How to create a Volume Group see Section LVM.

inconsistent capitalization of 'volume group'

> +
> + # lvcreate -L 80G -T -n vmstore vmdata
> -- 
> 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