I need an explanation or a confirmation of how LVM volume can be expanded.
Below here's the storage management that come from a single VM that has 1 physical disk, this one is split into sda1 as a primary partition for Linux boot, sda2, as a primary partition and managed by LVM, sda3 and sda5 are unknown to me. I only see that sda3 is a primary partition too but sda5 is a logical one.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 976M 0 part /boot
├─sda2 8:2 0 40,5G 0 part
│ ├─vg-swap 254:0 0 3,8G 0 lvm [SWAP]
│ ├─vg-root 254:1 0 22,9G 0 lvm /
│ ├─vg-home 254:2 0 4,8G 0 lvm /home
│ ├─vg-var 254:3 0 5,7G 0 lvm /var
│ └─vg-tmp 254:4 0 3,3G 0 lvm /tmp
├─sda3 8:3 0 1K 0 part
└─sda5 8:5 0 3,5G 0 part
Now what if i want to extend my VG, for example , add +5GB to /var or /home. I read a lot of articles whom i sum up two ways to add storage :
people add a new disk to the VM configuration , create a new primary partition and then add it to the VG - logical volume is extended but now the VM got 2 disks
people expend disk from the VM configuration, then create a new primary partition and then add it to the VG
These methods seems to work once isn't it ? i mean if i add +5 GB to my VM then create a primary partition, and i want to do the same tomorrow, i may be blocked due to primary partitions limits from sda1-sda4 ?
How can i properly extend one of my logical volume many times ?