Five minutes to understand Linux disk logical volume management LVM

LVM concept

LVM ( Logical Volume Manager , logical volume management) is a mechanism for managing disk partitions in the Linux environment. The working principle of LVM is actually very simple. It abstracts and encapsulates the underlying physical hard disk, and then presents it to the upper-layer application as a logical volume. In the traditional disk management mechanism, our upper-layer application directly accesses the file system to read the underlying physical hard disk. In LVM, it encapsulates the underlying hard disk. When operating, it no longer operates on the partition, but performs the underlying disk management operation on it through a thing called a logical volume. For example, if I add a physical hard disk, the upper-layer service cannot be felt at this time, because the upper-layer service is provided through the logical volume. As a dynamic disk management mechanism, logical volume technology greatly improves the flexibility of disk management!

To understand the principles of LVM, we must first master four basic logical volume concepts.

PE   (Physical Extend) physical expansion

PV   (Physical Volume) physical volume

VG   (Volume Group) volume group

LV   (Logical Volume) logical volume

The relationship between the four concepts is as follows:

Summary of LVM

Finally, we give a brief summary of the working principle of LVM

(1) The physical disk is formatted as PV, and the space is divided into individual PEs;

(2) Different PVs are added to the same VG, and the PEs of different PVs all enter the PE pool of the VG;

(3) LV is created based on PE, and its size is an integer multiple of PE. The PEs that make up LV may come from different physical disks;

(4) The expansion and reduction of the LV is actually to increase or decrease the number of PEs that make up the LV, and the original data will not be lost during the process.

Guess you like

Origin blog.csdn.net/liwenxiang629/article/details/131891972