1. Introduction
Logical scroll bar manager (English: Logical Volume Manager, abbreviated as LVM), also translated into logical file Manager, logical Sector Manager, Logical Disk Manager, is the logical scroll bar management provided by Linux core (Logical Volume Management) function. It is on the hard disk partition on the hard disk, but also create a logical layer to facilitate the system to manage the hard disk partition system.
The LVM system administrator makes it easy to manage disk partitions, such as connecting several disk partitions into an entire block of volume groups (volumegroup) to form a storage pool. Administrators can create logical volume groups (logicalvolumes) randomly on volume groups and further create file systems on logical volume groups. Administrators can easily adjust the size of storage volume groups through LVM, and can name, manage, and distribute disk storage by group, for example, by definition by usage: "Development" and "sales" instead of using the physical disk name "SDA" and "SDB". And when a new disk is added to the system, the LVM administrator does not have to move the disk's files to the new disk to make the most of the new storage space, but directly extends the file system across the disk.
2. Basic Terminology
LVM is a logical layer that is added between the disk partition and the file system to shield the file system from the lower partition layout, providing an abstract disk volume, and creating a filesystem on the disk volume. First we discuss the following LVM terms:
* Physical storage media (Thephysicalmedia)
This refers to the system's storage device: The hard disk, the storage system is the lowest level of storage unit.
* Physical Volume (Physicalvolume)
A physical volume is a hard disk partition or a device (such as RAID) that has the same functionality as a disk partition, and is the basic storage logic block of LVM, but is compared to basic physical storage media (such as partitions, disks, and so on) but contains administrative parameters related to LVM.
* Volume Group (volumegroup)
An LVM volume group is similar to a physical hard disk in a non-LVM system, which consists of a physical volume. You can create one or more "LVM partitions" (logical volumes) on a volume group, and the LVM volume group consists of one or more physical volumes.
* Logical Volume (Logicalvolume)
The LVM logical volume is similar to a hard disk partition in a non-LVM system, where a file system (such as/home or/usr, etc.) can be built on top of a logical volume.
*pe (physicalextent)
Each physical volume is divided into basic units called PE (physicalextents), with a unique number of PE being the smallest unit that can be addressed by LVM. The size of the PE is configurable and the default is 4MB.
*le (logicalextent)
The logical volume is also divided into the addressable base unit called LE (logicalextents). In the same volume group, Le's size and PE are the same, and one by one correspond.
First you can see that the physical volume (PV) is made up of basic unit PE of equal size.
A volume group consists of one or more physical volumes.
As you can see from the above picture, PE and Le have one by one corresponding relationships. Logical volumes are built on volume groups. Logical volumes are the equivalent of a non-LVM system's disk partition, where you can create a file system.
The following illustration is a schematic diagram of the logical relationship between a disk partition, a volume group, a logical volume, and a file system:
and non-LVM systems store metadata that contains partition information in a partitioned table at the start of a partition, as well as in the Vgda (Volume Group descriptor area) that is associated with the logical volume and the volume group. Vgda includes the following: PV descriptor, VG descriptor, LV descriptor, and some PE descriptors.
When the system starts LVM, it activates the VG and loads the Vgda into memory to identify the actual physical storage location of the LV. When I/O operations are performed by the system, the actual physical location is accessed based on the mapping mechanism established by VGDA.
References: Baidu Encyclopedia and Wikipedia