Lvm
Install lvm2
apt-get install lvm2
Use fdisk to change partition type to linux-lvm (use t command to change patition's system id)
Create physical volumes of all lvm partitions DATA GETS LOST!
pvcreate /dev/sda4 /dev/sda2
Create volumegroup
vgcreate vol_grp1 /dev/sda2
Create logical volume
lvcreate -L 10M vol_grp1
Create ext4 filesystem
mkfs.ext4 /dev/vol_grp1/lvol?
tune2fs -m 0 /dev/vol_grp1/lvol?
-l, --extents LogicalExtentsNumber[%{VG|PVS|FREE|ORIGIN}]
Gives the number of logical extents to allocate for the new logical volume.
-L, --size LogicalVolumeSize[bBsSkKmMgGtTpPeE]
Gives the size to allocate for the new logical volume. A size suffix of K for kilobytes, M for megabytes, G for giga‐
bytes, T for terabytes, P for petabytes or E for exabytes is optional.
Default unit is megabytes.