How to implement LVM under Linux

Source: Internet
Author: User
Tags file system linux

LVM (Logical Disk Management)

Introduction of LVM

LVM is a shorthand for Logical Volume Manager (Logical Volume management), which is implemented by Heinz Mauelshagen on the Linux 2.4 kernel. LVM sets the partitions of one or more hard disks logically together. The equivalent of a large hard disk to use, when the hard disk space is not used, you can continue to add other hard disk partition, which can achieve dynamic management of disk space, compared to ordinary disk partitions have great 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 applications and users. Storage volumes under LVM management can be resized and removed at any time as needed (the 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 ').

The LVM model as shown in the figure:

Four partitions can form a large space, and then partition some logical partitions in these spaces, when a logical partition is not enough space, you can partition some space from the remaining space to use the space is not enough.

Ii. the basic terminology of LVM

As mentioned earlier, LVM is a logical layer that is added between the disk partition and the file system to shield the file system from the lower disk 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 (physical media): This refers to the system's storage device: A hard disk, such as:/DEV/HDA1,/DEV/SDA, etc., is the storage system at the lowest level of storage units.

Physical volume (physical volume): 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 (Volume Group): 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 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 built on top of logical volumes.

PE (physical extent): each physical volume is divided into basic units called PE (physical extents), 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 (logical extent): The logical volume is also divided into the addressable base unit called LE (logical extents). In the same volume group, Le's size and PE are the same, and one by one correspond.

In short, it is:

PV: is a physical partition of the disk

The physical disk partition in VG:LVM, or PV, must be in VG, which can be understood as a warehouse or several large hard drives.

LV: A logical partition divided from VG

The following figure shows PV, VG, LV three relations:

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.