Storage 5--Logical Volume management LVM

Source: Internet
Author: User

1. LVM Concept

LVM is shorthand for Logical Volume Manager (Logical Volume management), which is implemented by Heinz Mauelshagen on the Linux 2.4 kernel. LVM sets the partition of one or more hard disks logically, equivalent to a large hard disk to use, when the hard disk space is not enough to use, you can continue to add the partitions of other hard disks, so that the dynamic management of disk space, relative to the normal disk partition has a lot of flexibility.

LVM provides a higher level of disk storage for computers than traditional disks and partitions. It makes it easier for system administrators to allocate storage space for apps and users. Storage volumes under LVM management can be resized and removed as needed at any time (file system tools may need to be upgraded). LVM also allows storage volumes to be managed by user groups, allowing administrators to identify storage volumes with more intuitive names (such as "Sales", "development") instead of physical disk names (such as ' SDA ', ' SDB ').

  

2. LVM Terminology

LVM is a logical layer that is added between the disk partition and the file system to mask the underlying disk partition layout for the file system, providing an abstract disk volume, and creating a file system on the disk volume. First we discuss the following LVM terminology:

Physical storage media (the physical media): This refers to the system's storage device: The hard disk, such as:/DEV/HDA1,/DEV/SDA, etc., is the lowest layer of storage system storage unit.

Physical Volume (physical volume): a physical volume refers to a hard disk partition or a device (such as a raid) that logically has the same function as a disk partition, which is the basic storage logic block of LVM, but compared to basic physical storage media such as partitions, disks, etc. Contains management parameters that are relevant to LVM.

Volume Group (Volume Group): LVM volume groups are similar to physical hard disks in non-LVM systems, which consist of physical volumes. You can create one or more LVM partitions (logical volumes) on a volume group, and an LVM volume group consists of one or more physical volumes.

logical volumes (logical volume): LVM logical volumes are similar to hard disk partitions in non-LVM systems, and file systems (such as/home or/usr) can be created on top of logical volumes.

PE (physical extent): each physical volume is divided into a basic unit called PE (physical extents), with a uniquely numbered PE being the smallest unit that can be addressed by LVM. The size of the PE is configurable and defaults to 4MB.

LE (logical extent): Logical volumes are also divided into addressable basic units called LE (logical extents). In the same volume group, the size of Le is the same as the PE, and one by one corresponds.

In simple terms:

PV: is a physical partition of the disk

The physical disk partition in VG:LVM, which is PV, must be added to the VG, which can be understood as a warehouse or a few large hard disks.

LV: The logical partition from the VG

As shown in PV, VG, LV three relations:

3. LVM Overall structure

The logical Volume Manager (LVM) controls disk resources by mapping data between the logical view of the storage space and the actual physical disk. The implementation is to load a layer of disk device driver code on top of the traditional physical device driver layer. This disk stores logical views for application use and is independent of the underlying physical disk structure

The following structural hierarchy diagrams describe the management of fixed disk storage, with well-defined mappings between tiers (including volume groups (datavg), logical volumes (lv04 and mirrlv), logical partitions (LP1, ..... ), physical volumes (HDISK9), and physical partitions (PP8)).

Each individual disk device is called a physical volume and is given a name, usually/dev/hdiskx (x is the only integer value in the system). Each physical volume being used belongs to a volume group (VG) unless it is a raw storage disk device or an off-the-shelf backup disk (commonly known as hot spare). Each physical volume contains a number of overlapping disks (or platters) that are divided into fixed-size physical partitions. For spatial allocation, each physical volume is divided into five regions: (Outer edge, outer middle, center, inner middle, and inner edge), which can be seen as a cylindrical segment that is cut vertically through a disk platter (see Figure 3). The number of physical partitions per region varies with the total capacity of the disk device.

Logical Volume Manager (LVM) is an operating system command, a library subroutines program, and other collections that allow users to establish and control logical volume storage. As mentioned earlier, the Logical Volume Manager (LVM) controls disk resources by mapping data between the logical view of the storage space and the actual physical disk. The implementation is to load a layer of disk device driver code on top of the traditional physical device driver layer. This disk stores logical views for application use and is independent of the underlying physical disk structure

The logical Volume Manager (LVM) manages RAID disk arrays in the same way. The RAID array is treated as a single disk, even in the vast majority of cases it has considerable capacity.

After successful installation, the system has a volume group (root volume group called ROOTVG), which includes the logical volumes necessary to boot the system and other logical volumes specified by the installation script. Other physical volumes connected to the system can be added to the volume group (using the EXTENDVG command) or used to create a new volume group (using the MKVG command).

Volume groups and physical volumes have the following relationships:

    • On a single system, one or more physical volumes can form a volume group.
    • Physical volumes cannot be shared between volume groups.
    • The entire physical volume becomes part of the volume group.
    • LVM is independent of physical volumes. Therefore, different types of physical volumes can form a volume group.

Within each volume group, one or more logical volumes are defined. A logical volume is an area of disk that is used to store data, which is contiguous for the application, but may be discontinuous on the actual physical volume. Logical volumes can scale, relocate, span multiple physical volumes, and their content can be replicated to provide greater flexibility and scalability.

Each logical volume contains one or more logical partitions (LPs). Each logical partition corresponds to at least one physical partition. If the logical volume is mirrored protected, the system allocates additional physical partitions to store the replicated data for each logical partition. To ensure availability, this data is typically located on different physical volumes, but sometimes for performance reasons, it may also be on the same physical volume.

Logical volumes can be created or modified from a command or Smit menu.

A logical volume can belong to only one volume group. A logical volume can:

    • In a physical volume
    • Multiple physical volumes across a single volume group
    • Multiple mirrors on different physical volumes in the same volume group

Summarize:

Physical Volume: A storage disk device that can be divided into multiple physical partitions

Volume Group: A collection of one or more physical volumes, independent of type

logical Volumes: a collection of logical partitions in which each logical volume can be mapped to any physical partition within a volume group. If mirroring is used, a logical partition is mapped to 2 or 3 physical partitions.

Logical Volume Manager: the above members are controlled by a logical volume disk drive. It is responsible for managing the complex structure of the physical partitions, including mirroring, presenting a single logical partition to the user/application.

Storage 5--Logical Volume management LVM

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.