Alfonso Baqueiro Bernal
Tuesday Sep 6, 2022

LVM

LVM is an acronym for Logical Volume Manager, is a solution similar to others like Veritas to manage disk space in a more flexible way than what disk partitions provide, partitions are a way to reserve and allocate disk chunks to acomadate a FILESYSTEM (a convention of rules and code of how to manage files and permissions on a disk chunk, most known are FAT32, exFAT, NTFS, ext2, ext3, ext4, reiserFS, etc).

The great thing about LVM is that you can create as many volumes as you need, and that you can easily extend and shrink them, you can delete them, and this volumes can contain a filesystem.

Of course, disk chunks for LVM have to be a normal partition, but is a type of partition for this purpose, that can be created with fdisk or other more advanced tools like parted or gparted (nice GUI). A common scenario is to create only one partition of type LVM taking all available space.

(Being precise a LVM can be created on any block device (disk partition, whole disk, raid device, other LVM logical volume, etc)

Concepts

LVM
Logical Volume Manager
PV - Physical Volume
Is a partition or whole disk designated for LVM use. Must be initialized.
VG - Volume Group
A collection of physical volumes which creates a pool of disk space out of which logical volumes can be allocated
LV - Logical Volume
Is a mountable storage device.

Use cases for LVM

Command reference

pvcreate
initialize a disk or partition for use by LVM
pvdisplay
display attributes of a physical volume
vgcreate
create a volume group
vgdisplay
display attributes of volume groups
lvcreate
create a logical volume in an existing volume group
lvdisplay
display attributes of a logical volume
lvextend
extend the size of a logical volume

Resources