What`s the reason of local-lvm

Ivan Gersi

Renowned Member
May 29, 2016
83
7
73
54
I upgraded 4.4 to 5.2....with clean isntall. I had a lot of problems with upgrading several times so I decide a fresh install.
I`m little surprisnig now, 5.2.1 create 3 lvm partition, swap, root, data. Data is marked as local-lvm. I understanding.
But why is /var/lib/bz mounted to /? Why I use data (local-lvm) as a destination for new VM?
root@pve1:/etc# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 256M 0 part
└─sda3 8:3 0 3.7T 0 part
├─pve-swap 253:0 0 8G 0 lvm [SWAP]
├─pve-root 253:1 0 96G 0 lvm /
├─pve-data_tmeta 253:2 0 15.8G 0 lvm
│ └─pve-data 253:4 0 3.5T 0 lvm
└─pve-data_tdata 253:3 0 3.5T 0 lvm
└─pve-data 253:4 0 3.5T 0 lvm
sr0 11:0 1 1024M 0 rom
I can create VM only in / partition. What`s the main reason of this state?
I know, I can formate data lvm, mount /var/lib/vz and edit fstab...etc...but this is the right way?
What is the best practises?
I have only local in old PVE (4.4.13) with clear structure.
root@pve2:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 1007K 0 part
├─sda2 8:2 0 127M 0 part /boot/efi
└─sda3 8:3 0 3.7T 0 part
├─pve-root 251:0 0 96G 0 lvm /
├─pve-swap 251:1 0 15G 0 lvm [SWAP]
└─pve-data 251:2 0 3.5T 0 lvm /var/lib/vz
sr0 11:0 1 1024M 0 rom
I understand thsi structure and works fine for me.
Is this the right way?
 
the 'data' lv in the 'pve' vg is a lvmthin storage

this is already the default since 4.2

if you do not want lvmthin, then yes you can delete/reformat/partition/etc. how you like

lvmthin is a layer less than a file on an ext4 filesystem
 
Is there some advantages of this state? I have a relatively big VMs (ovet 1.1TB) and migrating between nodes or recovering from backup is hot long. Maybe if this state can me some uknown advantages...
Can you give me some example?
 
lvmthin has fewer steps to the disk

guestfs -> lvmthin -> disk

in contrast to a filesystem with a file

guestfs -> file -> hostfs -> disk

also it is a 'raw' storage and not 'cow' making it a little bit faster (depending on the workload) in comparison to qcow2
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!