Linux operating system Logical Disk volume management LVM detailed

Source: Internet
Author: User
Tags file system linux

Summary: One of the most common and difficult decisions that Linux users encounter when installing a Linux operating system is how to properly assess the size of each partition to allocate appropriate hard disk space. When a partition space is exhausted, the solution is usually to use symbolic links, or tools that resize the partition (such as Patition magic, etc.), but this is a temporary solution and does not fundamentally solve the problem. With the advent of Linux Logical Disk volume management functions, these problems are solved, this article in-depth discussion of LVM technology, so that users can easily adjust the size of each partition without downtime.

First, the preface

Every Linux user has a dilemma when installing Linux: How to accurately evaluate and allocate the capacity of each hard disk partition when partitioning the system, because the system administrator should not only consider the capacity required for a current partition, but also anticipate the maximum capacity that the partition might need later. Because if the estimate is inaccurate, administrators may even want to back up the entire system, clear the hard disk, repartition the hard disk, and then restore the data to the new partition when a partition is not enough.

Although there are a lot of dynamic disk-tuning tools available now, such as Partation magic, it doesn't completely solve the problem because one partition may be depleted again, and in another, it will require a reboot of the system to achieve, and for many key servers, downtime is unacceptable, And for adding a new hard disk, you want a file system that spans multiple hard drives, the partitioning adjustment program does not solve the problem.

Therefore, the perfect solution should be 0 downtime under the premise of the file system can easily adjust the size, can facilitate the implementation of file systems across different disks and partitions. Fortunately, the Logical Disk volume management (lvm,logical Volume Manager) mechanism provided by Linux is a perfect solution.

LVM is the abbreviation for Logical Disk volume management (Logical Volume Manager), a mechanism for managing disk partitions in a Linux environment, and LVM is a logical layer built on the hard disk and partitions to improve disk partition management flexibility. The LVM system administrator makes it easy to manage disk partitions, such as connecting several disk partitions into an entire volume group (volume group) to form a storage pool. Administrators can create logical volume groups (logical volumes) on volume groups at will, 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.

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 (the physical media)

This refers to the system storage device: 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 Volume (logical volume)

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 (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)

Logical volumes are also divided into addressable basic units called LE (Logical extents). In the same volume group, Le's size and PE are the same, and one by one correspond.

Related Article

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.