Volume Group (VG)

Create : vgcreate vgname /dev/device
Extend : vgextend vg /dev/device

Logical Volume (LV)

Create : lvcreate -L 20G -n new_lv vgname
For a complete example :

lvcreate -L 20G -n new_lv vgname
mkfs /dev/vg/new_lv
mkdir /new_lv
mount /dev/vg/new_lv /new_lv

Remove : lvremove /dev/vg/lv
Extend : lvextend -r -L +10G /dev/vg/lv or
lvextend -l +100%FREE /dev/vg/lv
Reduce : lvresize -L FINALSIZE /dev/vg/lv

Storage stuff

Resize swapp

swapoff -v /dev/vg/lv
lvreduce /dev/vg/lv -L -512M #Taille finale
mkswap /dev/vg/lv
swapon -va

VMWARE

Adding disk : echo "- - -" > /sys/class/scsi_host/host0/scan Extend disk :

echo 1 > "/sys/bus/scsi/devices/0:0:2:0/rescan"
echo 1 > "/sys/block/$DISK/device/rescan"
partprobe
pvresize /dev/$disque

Extend RAM : for i in $(find /sys/devices/system/memory/ -type f -name online); do echo 1 > $i; done
Extend CPU : echo 1 > /sys/devices/system/cpu/cpu*/online