Table of Contents

Create partitions

fdisk - create partitions with 8e code (LVM)

# fdisk /dev/sdc

Create physical volumes

# pvcreate /dev/sdb1 /dev/sdc1
# pvdisplay
# pvs
# pvremove /dev/sdb1 /dev/sdc1 //-wipe previous content
# pvresize

Create Volume Group

# vgcreate -s 64M volumename /dev/sdb1 /dev/sdc1
# vgdisplay
# vgrename
# vgscan
# vgextend volumename /dev/sdb3

PVMove

pvmove

Logical Volume

Create thin share of 40GB size with volumename (-T Thin provisioning)
You may leave some free space for snapshots (16GB for example) otherwise snapshots will not work.

# lvcreate --name share -T --size 40G volumename
# lvcreate --name share -l 100%FREE volumename
# lvdisplay
# lvrename
# lvscan
# lvremove
# lvextend -L1.5G /dev/volumename/share
# lvreduce -L1G /dev/volumename/share

Remove reserved space for root user

tune2fs -m 0 /dev/sdXY

Import LVM on another system

vgchange -ay