LVM is an abstract software layer on physical hard drives. It provides an easier, and flexible storage management by creating logical volumes. Proxmox VE supports LVM backend for VM and container storage. This tutorial will help you to create an LVM volume with multiple drives and add it in Proxmox VE for VM and Container storage.
If you would like to start by installing Proxmox VE instead go to my post here.
1. Install the hard disks and check if they are visible under Disks menu on PVE web interface. I have two drives which are going to be used for the LVM.
2. To prepare the disks for LVM creation, first wipe them.
wipefs -a /dev/sdb /dev/sdc
3. Create physical volumes on the disks using pvcreate. Physical volumes are the basic blocks of LVM storage.
pvcreate /dev/sdb /dev/sdc
4. Next create a volume group with all the disks. Volume group will combine all physical volumes to give one central storage structure.
vgcreate vgrp /dev/sdb /dev/sdc #vgrp is the name of the vol group
5. Go to PVE web interface. Under Disks -> LVM you should see the volume group ‘vgrp’.
6. Under Datacenter -> Storage. Add a LVM with a unique ID and the volume group we created above, as below. This will allow Proxmox to store the contents.
You can now use this for Disk Image, Containers, meanwhile managing it easily via Linux LVM manager.