Setup lvm2
 
            
            
            
            
            Setup lvm2
Create physical volume
pvcreate /dev/sda4Physical volume “/dev/sda4” successfully created
Create a logical volume group called pve
vgcreate pve /dev/sda4Volume group “pve” successfully created
Create volume group
If you really need to assign all space on partition this is the way to do it. This is not a good idea as snapshots will not work.
lvcreate -l 100%VG -n storage pveto use 90%
lvcreate -l 90%VG -n storage pveIf you plan to support lvm snapshots do not use 100% space as you need a second lvm volume.
Logical volume “storage” created
Create filesystem
mkfs.ext4 /dev/mapper/pve-storageWriting superblocks and filesystem accounting information: done
Display your setup
Display Physical volume
pvdisplay -v -mDisplay Volume group
vgdisplayDisplay Logical volume
LVM volumes follow the convention: /dev//.
lvdisplay /dev/pve/storageSnapshots
N.B. when LVM2 snapshot, the destination of the backup must be outside the LVM volume that contains the VM you are backing up (i.e. if your VM is in /pve/data that is mounted as /var/lib/vz, you can’t save the backup in /var/lib/vz/dump).
 Never miss a story from us, subscribe to our newsletter
   Never miss a story from us, subscribe to our newsletter