A picture that lets you learn LVM

Source: Internet
Author: User

Guide With the progress of science and technology, people unknowingly entered the era of big data, the increasing number of data we found that our disk is more and more inadequate, the next is the headache of things-plus hard disk, data backup and restore. LVM is specifically for our data under the expansion of Linux, on the basis of the original dynamic disk to adjust the size of the disk dynamically, LVM dynamic volume management, a picture to give you a deep understanding of the use of LVM.

lvm--logical Volume Manager

LVM is dynamic volume management, can be multiple hard disk and hard disk partition into a logical volume, and this logical volume as a whole to unified management, dynamic partition to expand the size of the space, safe and efficient and convenient management.

Four concepts:

①pe (physical Extend) physical expansion

②PV (physical Volume) Physical volume

③VG (Volume Group) volume group

④LV (Logical Volume) Logical Volume

Features:

The most important feature of LVM is the ability to dynamically manage disks. Because the size of the logical volume can be dynamically adjusted, and no existing data is lost. If we add a new hard disk, it will not change the existing upper-level logical volumes. As a dynamic disk management mechanism, logical volume technology greatly improves the flexibility of disk Management!

working principle:

(1) The physical disk is formatted as PV, and the space is divided into a PE
(2) Different PV added to the same VG, different PV PE all entered the VG PE Ikeuchi
(3) LV is created based on PE, the size is an integer multiple of PE, the PE composed of LV may come from different physical disks
(4) LV now directly can be formatted after mounting using the
(5) The LV expansion reduction is actually increasing or decreasing the number of PE components that make up the LV, and the process does not lose the original data

Operation:


1. View:

PES, pedisplay view PE size (pes==pescan) PVS, pvdisplay View physical volume VGS, vgdisplay, view volume group LVS, Lvdisplay, view logical Volume FDISK-L view disk partitions

2. Create:

Pvcreate Device Path Create physical volume Vgcreate name PV path Create Volume group Lvcreate-n name-L size VG name create Logical volume format: MKFS.EXT4 LV full path formatted logical volume (MKFS. File System format or-T file system format) Mount: Mount LV full path mount point mount Use (can use/etc/fstab or autofs)

3. Logical Volume Deletion:

1. Uninstall: Umount 2. Delete lv:lvremove LV full path 3. Delete Vg:vgremove VG name 4. Delete Pv:pvremove device full path to drive

4. Logical Volume Expansion:

1. Expand PV: Equivalent to create PV 2. Extended vg:vgextend VG Name added PV path 3. Extended Lv:lvextend-l + scale LV full name 4. Refreshing the file system: RESIZE2FS LV Full path NOTE: Flexible use, see the actual situation, attention to order (support Online operation)

5, the reduction of logical Volume:

1. First uninstall umount Check file system: E2fsck-f LV Full path 2. Reduced file system: RESIZE2FS LV Full path reduced to size 3. Reduced LV Volume size: lvreduce-l-Reduce the size of the amount of LV's full path 4. Mounting use reduction required Caution, the size of the file system must be equal to the final size of the LV volume

LVM is actually very simple, look at the big picture above, do it a few times quickly!

This article was reproduced from:http://www.linuxprobe.com/one-picture-to-learn-lvm.html

more Linux Dry Goods visit:http://www.linuxprobe.com/

A picture that lets you learn 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.