Panel For Example Panel For Example Panel For Example

LVM Disk Management in Linux: Practical Guide

Author : Adrian September 16, 2025

What is LVM

LVM is the logical volume manager for the Linux operating system. There are two historical versions, LVM1 and LVM2. LVM1 is a mature implementation; LVM2 is the more recent and generally recommended version. LVM2 is almost fully backward compatible with volumes created by LVM1, with the notable exception of snapshots (snapshots must be removed before upgrading to LVM2).

Overview

Logical volume management provides a higher-level view of disk storage than traditional disks and partitions. This makes it easier for administrators to allocate storage to applications and users more flexibly.

Volumes created under a logical volume manager can be resized and moved more freely, although file system tools may require adjustments.

LVM also allows management of storage as named groups, enabling administrators to work with meaningful group names (for example, "development" and "sales") rather than physical device names such as "sda" or "sdb".

Basic Terms

Volume Group (VG)

A volume group is the highest-level abstraction used by LVM. It aggregates logical volumes and physical volumes into a single management unit.

Physical Volume (PV)

A physical volume is typically a disk or a disk partition, though it can also be a device that appears as a disk (for example, a software RAID device).

Logical Volume (LV)

A logical volume is equivalent to a partition in a non-LVM system. LVs appear as standard block devices and can contain file systems (for example, /home).

Physical Extent (PE)

Each physical volume is divided into blocks called physical extents. These extents have the same size as the logical extents configured for the volume group.

Logical Extent (LE)

Each logical volume is divided into logical extents. All logical extents in a volume group have the same size.

Relationship Between Concepts

Consider this example:

Assume a volume group named VG1 with an extent size of 4 MB. Two disk partitions, /dev/hda1 and /dev/hdb1, are added to this group. These partitions become physical volumes PV1 and PV2.

Each PV is divided into 4 MB extents. If PV1 provides 99 extents and PV2 provides 248 extents, the volume group has 347 extents total. Logical volumes can be created with sizes between 1 and 347 extents.

When creating a logical volume, mappings are defined between logical extents and physical extents. For example, logical extent 1 might map to physical extent 51 on PV1; the first 4 MB written to that logical extent is stored in PV1's extent 51.

Mapping Modes

Linear mapping: assign a contiguous range of PEs to a region of an LV. For example, LE 1-99 maps to PV1, LE 100-347 maps to PV2.

Striped mapping: interleave logical extents across multiple physical volumes. This can improve performance. For example:

1st chunk of LE[1] -> PV1[1] 2nd chunk of LE[1] -> PV2[1] 3rd chunk of LE[1] -> PV3[1] 4th chunk of LE[1] -> PV1[2]

Snapshots

Snapshots allow creation of a new block device representing an exact copy of a logical volume at a point in time. This enables administrators to back up data in a consistent state and then remove the snapshot once the backup is complete.

Snapshots initially contain only metadata about the snapshot, not the actual data from the source LV. They use copy-on-write: when a source block is modified after the snapshot, the original value is copied into the snapshot volume before the source block is updated.

As more blocks change on the source LV, the snapshot grows. If the snapshot volume fills up, the snapshot will be discarded, so it is important to allocate sufficient space based on expected change-rate. If the snapshot is as large as the original data, it will not overflow.

Installing LVM

[root@centos7 ~]$ rpm -q lvm2 # Check whether lvm2 is installed; on this system centos7 it is installed lvm2-2.02.171-8.el7.x86_64 [root@centos7 ~]$ # yum -y install lvm2 # Use yum to install if not present

Common Commands

[root@centos7 ~]$ pv # Use tab to complete pv-related commands pvchange pvck pvcreate pvdisplay pvmove pvremove pvresize pvs pvscan [root@centos7 ~]$ vg # Use tab to complete vg-related commands vgcfgbackup vgck vgdisplay vgimport vgmknodes vgrename vgsplit vgcfgrestore vgconvert vgexport vgimportclone vgreduce vgs vgchange vgcreate vgextend vgmerge vgremove vgscan [root@centos7 ~]$ lv # Use tab to complete lv-related commands lvchange lvdisplay lvmconf lvmdump lvmsadc lvremove lvs lvconvert lvextend lvmconfig lvmetad lvmsar lvrename lvscan lvcreate lvm lvmdiskscan lvmpolld lvreduce lvresize

Brief explanations:

  • Commands prefixed with pv: operations related to physical volumes
  • Commands prefixed with vg: operations related to volume groups
  • Commands prefixed with lv: operations related to logical volumes
  • create: create resources
  • remove: remove resources
  • display: show status or details
  • import/export: import or export metadata
  • rename: rename resources
  • vgchange: change VG attributes
  • extend/reduce: expand or shrink capacities

Using LVM

Creating a Physical Volume

Purpose: initialize disk partitions or disks for use with LVM.

[root@centos7 ~]$ pvcreate /dev/sdb1

Notes

It is generally not recommended to initialize an entire disk as a PV because other operating systems may not recognize LVM metadata and could treat the disk as empty, risking accidental repartitioning and data loss.

If using a partition, set the partition type to LVM (hex code 8e).

Partitioning and Setting Partition Type

[root@centos7 ~]$ fdisk -l

Disk /dev/sda: 214.7 GB, 214748364800 bytes, 419430400 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x000b0b8a Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 270534655 134217728 83 Linux /dev/sda3 270534656 372934655 51200000 83 Linux /dev/sda4 372934656 419430399 23247872 5 Extended /dev/sda5 372938752 413898751 20480000 83 Linux Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x93d380cf Device Boot Start End Blocks Id System /dev/sdb1 2048 2099199 1048576 8e Linux LVM /dev/sdb2 2099200 4196351 1048576 8e Linux LVM Disk /dev/sde: 21.5 GB, 21474836480 bytes, 41943040 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x73afb36f Device Boot Start End Blocks Id System /dev/sde1 2048 2099199 1048576 8e Linux LVM /dev/sde2 2099200 6293503 2097152 8e Linux LVM Disk /dev/sdd: 21.5 GB, 21474836480 bytes, 41943040 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Device Boot Start End Blocks Id System /dev/sdd1 2048 2099199 1048576 8e Linux LVM /dev/sdd2 2099200 12584959 5242880 8e Linux LVM Disk /dev/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Device Boot Start End Blocks Id System /dev/sdc1 2048 2099199 1048576 8e Linux LVM /dev/sdc2 2099200 4196351 1048576 8e Linux LVM Disk /dev/sdf: 21.5 GB, 21474836480 bytes, 41943040 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@centos7 ~]$ partprobe Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only. [root@centos7 ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 200G 0 disk ├─sda1 8:1 0 1G 0 part /boot ├─sda2 8:2 0 128G 0 part ├─sda3 8:3 0 48.8G 0 part / ├─sda4 8:4 0 512B 0 part └─sda5 8:5 0 19.5G 0 part /app sdb 8:16 0 100G 0 disk ├─sdb1 8:17 0 1G 0 part └─sdb2 8:18 0 1G 0 part sdc 8:32 0 20G 0 disk ├─sdc1 8:33 0 1G 0 part └─sdc2 8:34 0 1G 0 part sdd 8:48 0 20G 0 disk ├─sdd1 8:49 0 1G 0 part └─sdd2 8:50 0 5G 0 part sde 8:64 0 20G 0 disk ├─sde1 8:65 0 1G 0 part └─sde2 8:66 0 2G 0 part sdf 8:80 0 20G 0 disk sr0 11:0 1 8.1G 0 rom /run/media/root/CentOS 7 x86_64

Recommended Reading
Deploying Deep Learning Gait Recognition on Allwinner V853

Deploying Deep Learning Gait Recognition on Allwinner V853

March 23, 2026

Gait recognition on an embedded Allwinner V853 board using NPU acceleration, detailing PyTorch-to-NB model conversion, CPU preprocessing/postprocessing and CASIA-B evaluation.

Article
Differences: DSP vs Microcontroller vs Embedded Microprocessor

Differences: DSP vs Microcontroller vs Embedded Microprocessor

March 20, 2026

Compare DSP, microcontroller, and embedded microprocessor designs: DSP signal processing optimizations, microcontroller peripheral integration, and power/performance tradeoffs.

Article
Choosing Peripherals for Embedded Systems

Choosing Peripherals for Embedded Systems

March 20, 2026

Guide to selecting peripherals in embedded systems: compare memory, clock sources, timers, communication interfaces, I/O and ADCs with factors like speed, power, and stability.

Article
Two Embedded Microprocessor Architectures and Their Pros and Cons

Two Embedded Microprocessor Architectures and Their Pros and Cons

March 20, 2026

Overview of embedded microprocessor architectures (CISC vs RISC), trade-offs, advantages and limitations for embedded system design, power, performance, and integration.

Article
Tesla Cuts Prices $2,000 on Three Main Models

Tesla Cuts Prices $2,000 on Three Main Models

March 20, 2026

Analysis of Tesla's recent price cuts, FSD subscription reduction and 14,000 layoffs after Q1 delivery declines, and competitive pressure from Chinese EV makers like BYD.

Article
Three Main Components of an Embedded Microprocessor

Three Main Components of an Embedded Microprocessor

March 20, 2026

Technical overview of the embedded microprocessor architecture, summarizing its three cooperating subsystems and how the compute unit enables arithmetic and logical execution.

Article