HDD (/dev/sda; dev/sdb2; etc) - PV (phisycal volume) - VG (volume group) - LV (logical volume)
apt-get install lvm2
apt-get install system-config-lvm (GUI tool)
apt-get install liblinux-lvm-perl
service lvm2 start1. HDD (/dev/sda; dev/sdb2; etc)
cfdisk /dev/sda -> create a partition with type Linux LVM (8e RHL/CentOS/Ubuntu 31Debian)
2. PV (phisycal volume)
pvcreate /dev/sdb1 /dev/sdb2 /dev/sdb5
3. VG (volume group)
vgcreate -A y --addtag VG1 -v VG1 /dev/sdb1 /dev/sdb2 /dev/sdb5
4. LV (logical volume) --> create a 2 partitons with 3GB allocated space
lvcreate -L 3G -n lvm_docs VG1
lvcreate -L 3G -n lvm_pics VG1
5. makefs
mkfs.ext4 /dev/VG1/lvm_pics
mkfs.ext4 /dev/VG1/lvm_docs
6. mount & use
Extend LVM volume for VMWare VM
1. Increasing the virtual hard disk
echo "- - -" > /sys/class/scsi_host/host0/scan
2. Partition the new disk space
cfdisk /dev/sda
rescan partitions: partprobe -s or partx -a /dev/sda3
3. Increasing the logical volume
pvcreate /dev/sda3
Device /dev/sda3 not found (or ignored by filtering) --> partscan/partx/kpartx
pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created
vgdisplay | grep -i "VG name"
vgextend VG1 /dev/sda3
Using the pvscan command we scan all disks for physical volumes
lvdisplay | grep -i path
LV Path /dev/VG1/lvm_docs
LV Path /dev/VG1/lvm_pics
lvextend /dev/VG1/lvm_docs /dev/sda3
resize2fs /dev/VG1/lvm_docs
https://www.tecmint.com/create-lvm-storage-in-linux/
https://wiki.debian.org/LVM