LVM in LINUX

VISHAL D BHAT
3 min readMay 25, 2022

A guide to LVM in Linux

Photo by Lukas on Unsplash

What is LVM” — LVM is a tool that is responsible for management of the Logical Volume, such as striping, mirroring, indexing, allocating disks and reinitializing disks.

ARCHITECHTURE OF LVM :

LVM Architechture — High Level
  1. Physical Volume are created from the partitions or a hard disk connected to the host machine. Using the command line LVM utilities these are converted into Physical Volumes by adding a label to these as well as appropriate meta data, so the system recognizes them as Physical Volumes.
  2. These physical volumes that come from actual physical devices are then grouped into what is called Volume Group.
  3. Logical Volumes are created from the Volume Group.
  4. Finally, we need to store data on these Logical Volumes, so we store the data on the File Systems created from them.

BEHIND THE SCENES :

Physical Extents — These are the blocks / chunks of storage within the Physical Volume to store the disk space. Default is 4MB, however it can range from KB to GB depending on the use case.

There are pointer mappings made between the Physical Volumes and the Logical Volumes.

SOME HANDS ON:

  1. List all the partitions available in the system — $ lsblk

2. Create a physical volume — $ pvcreate , Create a logical volume group — vgcreate

3. List all the physical volume and logical groups created

4. Create Logical Volume

5. Create a FS

--

--