LVM disk management
1. LVM introduction... 1
Ii. Basic Terms of LVM... 2
3. Install LVM... 3
4. create and manage LVM... 4
2. Create PV .. 6
3. Create VG... 7
4. Create LV .. 9
5. LV formatting and mounting... 10
I. Introduction to LVM
LVM is short for Logical Volume Manager (Logical Volume management), which is implemented by Heinz Mauelshagen on the Linux 2.4 kernel. LVM logically sets partitions of one or more hard disks, which is equivalent to a large hard disk. When the hard disk space is insufficient, LVM can continue to add partitions of other hard disks, this allows you to dynamically manage disk space, which is more flexible than common disk partitions.
Compared with traditional disks and partitions, LVM provides a higher level of disk storage for computers. It allows the system administrator to allocate storage space for applications and users more conveniently. Storage volumes under LVM management can be changed and removed as needed (File System Tools may need to be upgraded ). LVM also allows you to manage storage volumes by user group, allowing administrators to use more intuitive names (such as "sales" and "development ') replace the physical disk name (such as 'sda 'and 'sdb') to identify the storage volume.
LVM model:
A large space can be formed by four disk partitions, and then some logical partitions are divided in these spaces. When the space of a logical partition is insufficient, you can divide the remaining space into partitions that are insufficient for use.
Ii. Basic Terms of LVM
As mentioned above, LVM is a logical layer added between the disk partition and the file system to shield the file system from the underlying disk partition layout and provide an abstract disk volume, create a file system on the disk. First, we will discuss the following LVM terms:
The physical media refers to The storage device of The system, such as/dev/hda1 and/dev/sda. It is The storage unit at The lowest layer of The storage system.
Physical volume: A physical volume refers to a hard disk partition or a device (such as RAID) with the same functions as a disk partition logically. It is the basic storage Logical Block of LVM, however, compared with basic physical storage media (such as partitions and disks), it contains management parameters related to LVM.
Volume Group: An LVM Volume Group is similar to a physical hard disk in a non-LVM system. It consists of physical volumes. You can create one or more "LVM partitions" (logical volumes) on the volume group. The LVM volume group consists of one or more physical volumes.
Logical volume: the logical volume of LVM is similar to the hard disk partition in a non-LVM system. A file system (such as/home or/usr) can be created on the logical volume ).
PE (physical extent): Each Physical volume is divided into basic units called PE (physical Extents). pes with unique numbers are the smallest units that can be addressed by LVM. The PE size is configurable. The default value is 4 MB.
LE (logical extent): Logical volumes are also divided into the addressable basic units called LE (logical Extents. In the same volume group, the LE size and PE are the same and one-to-one correspondence.
In simple terms:
PV: A physical disk partition.
VG: physical disk partition in LVM, that is, PV, must be added to VG. You can think of VG as a warehouse or several large hard disks.
LV: the logical partition divided from VG.
See the following figure for the Relationship Among PV, VG, and LV:
3. Install LVM
First, determine whether the lvm tool is installed in the system:
[Root @ www root] # rpm-qa | grep lvm
Lvm-1.0.3-4
If the command result is similar to the preceding example, the LVM management tool is installed. If the command is not output, the LVM management tool is not installed, you need to download or install the LVM rpm toolkit from the network.
For more details, please continue to read the 2nd page content:
Mysqldump and LVM logical volume Snapshot
Comprehensive Introduction and implementation of LVM
MySQL high-performance backup solution for uninterrupted Data Access (LVM Snapshot Backup)
Implement ASM on LVM
LVM logical volume resizing
Expansion and reduction of LVM disk management