Introduction of LVM and experiment of common function flow

Source: Internet
Author: User

1) Preface

Always want to write a simple LVM aspects of the article, you can make a back, mainly in the process and examples, I hope the article can play a role. lvm= (Logical Volume mamager) Logical Volume Manager, LVM is first used on the IBM AIX system, its biggest function is the dynamic allocation of disk partitions, and can make multiple partitions or physical hard disk as a logical volume (equivalent to a logical hard disk). This mechanism allows for a flexible partitioning of the disk partition capacity.

Let's start with a simple example. For example, we have a hard disk/dev/hda, divided into 3 primary partitions: Hda1,hda2,hda3, the back of the disk space is not divided, the corresponding mount point is/boot,/,/home, if our/home space is not enough, how to do? The traditional method is to divide a partition in an undivided space, mount to the/home and copy the contents of the Hda3 to the new partition. Either mount the new partition to another mount point, and then create a link under/home to link to the new mount point.

Both methods are not good, the first method wastes the Hda3, and what if the subsequent partition capacity is less than Hda3? The second approach is not a waste of capacity, but it's troublesome to create additional links each time. So, what if you use LVM? The benefit of LVM is that you can dynamically enlarge a logical volume ( Equivalent to a logical partition), that is, if Hda3 is a logical partition, such as/dev/rootvg/lv3, then Lv3 can be dynamically magnified. This solves the problem of dynamic capacity adjustment. Of course, the prerequisite is that the system has a set of LVM support, and the device that needs to dynamically scale the mount point corresponds to a logical volume.

Here, all of my examples are based on Rhel 4/centos 4.x and LVM2.

2 LVM composition and concept

Here's a reference to IBM forest (Alex Lin) >)

PV (physical Volume) physical volume. Can be either a separate disk or a hard disk partition

VG (Volume Group) volume group. is a combination of PV that can be viewed as a separate logical disk

LV (Logical Volume) logical partition. /dev/hdax equivalent to physical partitions

PE (physical Extent) physical range. VG units, similar to the size of a raid stripe.

When multiple PV forms a VG, LVM makes similar formatting moves on all PV.

Each PV is cut into a block of space, this block of space is called PE, usually 4MB.

LE (Logical Extent) logical range. The constituent unit of the LV. A multiple of the size of PE (usually 1:1)

So, the list of the 3 most commonly used nouns and meanings is as follows:

Nominal meaning operating system corresponding equipment

PV Physical Volume/dev/hdax

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.