Terme informatique

LVM

LVM adds a flexible layer between physical disks and file systems.

⌚ About 2 min read
View my favorites

LVM organizes Linux storage in layers. PV, VG and. LV In order to make volumes more flexible than a simple partition. To diagnose it safely, you must always distinguish the size of the logical volume from that of the file system that it contains.

Simple definition

LVM adds a flexible layer between physical disks and file systems.

Technical definition

Logical Volume Manager organizes PV, VG and LV to facilitate expansion, reduction and Ports volume.

Expand LVM volume in a controlled manner.

First, use the target LV and the free space in the VG. When the environment allows, a command like. lvextend -r can expand the volume and request the adaptation of the file system, but check the compatibility and procedure of your distribution. After the operation, control.lvs, lsblk and visible space with.df -h.

What is it used for?

to evolve volumes without directly depending on a single physical partition.

Concrete example

a logical /var volume is extended after adding a new disk to the VG.

How to read LVM state?.

Use.pvs, vgs and. lvs for Novitier the.PV, VG and. LV. lsblk helps to connect logical volumes to devices and mount points. Before any extension, check the free VG dimensions and identify the file system; increasing a LV does not automatically mean that the filesystem will use the new space.

Common problems

The classic traps are to extend the. LV without expanding the file system, a adding a disk without properly creating or integrating the PV, or acting on the wrong volume. The reduction is more risky than the extension and depends heavily on the file system: some cannot be reduced. Save critical data before any operationDown.

FAQ — LVM.

What difference between PV, VG and LV?.

The PV represents physical storage managed by LVM, the VG groups PVs and the LV is the logical volume created in this group.

Why doesn’t df see the space added to the LV?.

The file system may not have been enlarged after the extension of the logical volume.

Can we reduce any, any LVM volume?.

No. Feasibility depends in particular on the file system and the operation can beDown; it requires a specific procedure and a suitable backup.

♡ 0