LVM implementation principle (PV, VG, LV, PE, le)

Source: Internet
Author: User

The LVM is attached to the DM function. The DM (device Mapper) is a ing Framework mechanism provided by the Linux 2.6 kernel from a logical device to a physical device. Under this mechanism, users can easily develop storage resource management policies based on their own needs. Currently, logical volume manager in Linux is popular, such as lvm2 (Linux Volume Manager 2 version) and evms (Enterprise Volume Management System) and dmraid (device mapper raid tool) are all implemented based on this mechanism.

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/40/9F/wKiom1PPKOGhBxkXAADTXlGA4Y4019.jpg "Title =" 20140723111228.jpg" alt = "wkiom1ppkoghbxkxaadtxlga4y4019.jpg"/>

PV: it is located at the bottom of the entire LVM system. It can be a partition, a physical disk, or a logical device, such as raid. Use the pvcreate command to create a partition as a physical volume (PV). This operation writes metadata related to logical volume management to the partition.

VG: The volume group is created on the physical volume. VG can be seen as a container that includes all the physical volumes of the subordinate. It can be seen that the volume group size is the total size of all physical volumes in the volume group. The vgcreate command can create a volume group, and vgextend can add a physical volume to a volume group.

PE: The physical disk area is the smallest storage unit used for management in the volume group. The size is determined when the volume group is created. Once the volume group is created, its PE size is fixed and unchangeable, the default PE size is 4 MB. The newly created PV does not have the concept of PE. Only when it is added to VG does it have PE.

LV: We know that VG is simply a container, which contains one or more PVS. VG cannot be formatted directly. LV is a logic layer created on top of VG and can be formatted and mounted. When creating a LV, specify the size, that is, the number of PES to be allocated to the LV. When the PE is allocated to a LV, it becomes le.

Le: The Logical Disk is the smallest storage unit managed by Lv. Its size is the same as the PE size in the VG where LV is located.

Note: As mentioned above, Le is not the smallest storage unit of data. The minimum storage unit of the data depends on the size of the disk block.

When you save data, there are two methods to perform LVM operations:

Linear mode (linear) --- Concatenates the space of multiple partitions, for example, a LV spans two partitions:/dev/sda1 and/dev/sda2, when data is stored, it is first written to/dev/sda1 and then/dev/sda2 when it is full. In this way, if a partition breaks down, the data will not be completely damaged.

Triped: stores data in a staggered manner. For example, if an LV spans/dev/sda1 and/dev/sda2, a file with four data blocks is saved, the first data block is saved in/dev/sda1, the second data block is saved in/dev/sda2, and the third data block is saved in/dev/sda1, and so on. In this way, if the LV spans two disks/dev/sda1 and/dev/sdb1, the performance will be improved, but it is best to use hardware raid to achieve this performance. In this mode, if a partition breaks down, the data will be damaged. Therefore, the default storage mode of LVM is linear)

This article is from the "diannaowa" blog, please be sure to keep this source http://diannaowa.blog.51cto.com/3219919/1442159

LVM implementation principle (PV, VG, LV, PE, le)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.