A summary of LVM learning

Source: Internet
Author: User

LVM full: Logical Volume Manager Logical Volume Manager. The practice of LVM is to combine several physical partitions (or disks) into a single, large disk, or VG, by means of a software method. The disk is then divided into the partition (LV) that can be used, and the last mount is used.

First introduce a few nouns:

1.physicalextend,pe Physical Expansion Fast:EstablishVGthe time specified by theBlockblock Size, default is4MB. AVGMaximum allowable65534aPE

    2.PHYSICALVOLUME,PV Physical Volume: Is Physical disk, similar to /dev/ SDA1 et cetera, by pe Physical disk blocks, multiple PV can be combined to form a Span lang= "en-US" style= "Font-size:10.5pt;background-color: #FFFFFF; line-height:21pt;" xml:lang= "en-us" >vg. Note: Use the FDISK command to adjust the system identifier of the partition to 8e.

3.Volume GROUP,VG Volume user group: A group of multiple physical volumes that cannot be used directly; you need to create a logical volume to use the combined space;thevg size depends on the physical volume,VG can be divided into multiple logical volumes (can be dynamically indented)

4.Logical volume,lv Logical Volume: Can be the VG all available space, there are two boundaries, one is a physical boundary, one is a logical boundary; it can be said that each logical volume is a filesystem, or a separate partition. A snapshot volume is in the same volume group as its logical volume.

For the LVM hierarchy:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/72/AD/wKiom1XrBSzD_g3tAABqEJIf8D4809.jpg "title=" Qq20150905230639.png "alt=" Wkiom1xrbszd_g3taabqejif8d4809.jpg "/>

LVM Authoring Process:

Use 3 partitions, SDA3,SDA5,SDA6

First use 3,5 to do PV

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AD/wKiom1XrBgPTU7iwAAC_ZY3aNiA621.jpg "title=" 1.png " alt= "Wkiom1xrbgptu7iwaac_zy3ania621.jpg"/>

View PV Information

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/AD/wKiom1XrBkbTJZ7DAADMZ52dPlg716.jpg "title=" 2.png " alt= "Wkiom1xrbkbtjz7daadmz52dplg716.jpg"/>

Scan PV

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/A9/wKioL1XrCKCxOpbmAAETFMgXObA517.jpg "title=" 3.png " alt= "Wkiol1xrckcxopbmaaetfmgxoba517.jpg"/>

Create a volume group MYVG

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/A9/wKioL1XrCNjCDG48AAB_jCML98c889.jpg "title=" 4.png " alt= "Wkiol1xrcnjcdg48aab_jcml98c889.jpg"/>

View VG Information

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/A9/wKioL1XrCR6ypjDgAAHD58FSTpk699.jpg "title=" 5.png " alt= "Wkiol1xrcr6ypjdgaahd58fstpk699.jpg"/>

Delete a volume group and create a new volume group, specifying a fast size of 32M

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/A9/wKioL1XrCZjyRz2TAAFG4RBlEpM721.jpg "title=" 6.png " alt= "Wkiol1xrczjyrz2taafg4rblepm721.jpg"/>

Verify that the VG you just created, and whether the specified PE size is 32M

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/A9/wKioL1XrCgyRhvTfAAHCCC-c9Ow817.jpg "title=" 7.png " alt= "Wkiol1xrcgyrhvtfaahccc-c9ow817.jpg"/>

To remove PV from a volume group

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/AD/wKiom1XrCDuBJxxIAADBtQnH-zo089.jpg "title=" 8.png " alt= "Wkiom1xrcdubjxxiaadbtqnh-zo089.jpg"/>

Looking at the results, we found that the MYVG size became 5g,sda3 was removed from the MYVG

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/A9/wKioL1XrCrHwCM7BAAFYn8ST0RM383.jpg "title=" 9.png " alt= "Wkiol1xrcrhwcm7baafyn8st0rm383.jpg"/>

Add a new PV to the MYVG

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AD/wKiom1XrCMCTbGLBAAJrEbS3pYM456.jpg "title=" 10.png "alt=" Wkiom1xrcmctbglbaajrebs3pym456.jpg "/>

Add the new PV to the VG, resulting in the MYVG size increased from 5G to 13G


Create a logical volume of size 5G mylv and view the logical volume information

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/AD/wKiom1XrCULyPfL0AAF16XGOVXY547.jpg "title=" 11.png "alt=" Wkiom1xrculypfl0aaf16xgovxy547.jpg "/>


Formatting logical Volumes

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/A9/wKioL1XrC8mihBcBAAOXUYbkc2Q557.jpg "title=" 12.png "alt=" Wkiol1xrc8mihbcbaaoxuybkc2q557.jpg "/>


Mount the logical volume MYLV to/MNT

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AD/wKiom1XrCfWR5cZfAAKGvQBWnEk638.jpg "title=" 13.png "alt=" Wkiom1xrcfwr5czfaakgvqbwnek638.jpg "/>


Expands the logical volume, adding 1G. You should extend the physical boundaries before extending the logical boundaries.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/A9/wKioL1XrDGXAy5jnAAOVJnOk1aY425.jpg "title=" 14.png "alt=" Wkiol1xrdgxay5jnaaovjnok1ay425.jpg "/>


Verifying the previous two-step operation

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/A9/wKioL1XrDK2RoqEtAAGRe8rPl2A305.jpg "title=" 15.png "alt=" Wkiol1xrdk2roqetaagre8rpl2a305.jpg "/>


Reduce the logical volume. Reduce the logical volume to 3G, force check before shrinking, and unload the device before shrinking

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AD/wKiom1XrCv7jGBVIAAHEdfyIVg8380.jpg "style=" float: none; "title=" 16.png "alt=" Wkiom1xrcv7jgbviaahedfyivg8380.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/A9/wKioL1XrDSXArDDmAAAxvCV3So8983.jpg "style=" float: none; "title=" 17.png "alt=" Wkiol1xrdsxarddmaaaxvcv3so8983.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/AD/wKiom1XrCv-TYemAAAEKe_wJ9QQ919.jpg "style=" float: none; "title=" 18.png "alt=" Wkiom1xrcv-tyemaaaeke_wj9qq919.jpg "/>


To verify the reduction operation, first /dev/myvg/mylv Mount to /mnt/

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AD/wKiom1XrCzTTARRtAAG4eIZ13b4722.jpg "title=" 19.png "alt=" Wkiom1xrczttarrtaag4eiz13b4722.jpg "/>


Create a Snapshot

First Copy the/etc/fstab to the /mnt.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/AA/wKioL1XrDa3ydDOzAAA_Hkjo7DU675.jpg "style=" float: none; "title=" 20.png "alt=" Wkiol1xrda3yddozaaa_hkjo7du675.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/AD/wKiom1XrC4fCN-7RAABJi663YUo085.jpg "style=" float: none; "title=" 21.png "alt=" Wkiom1xrc4fcn-7raabji663yuo085.jpg "/>


Create a 100M the snapshot volume, named Mylv-snap

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AD/wKiom1XrC7ODP-_zAAIGgXSU5tE056.jpg "title=" 22.png "alt=" Wkiom1xrc7odp-_zaaiggxsu5te056.jpg "/>


To mount a snapshot volume under /media/

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AA/wKioL1XrDgbwktCMAADx0-495dg647.jpg "title=" 23.png "alt=" Wkiol1xrdgbwktcmaadx0-495dg647.jpg "/>


Archive The contents of the snapshot volume to /backup under, and verify

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/AA/wKioL1XrDi-yRqMHAADQ75KMBAk319.jpg "title=" 24.png "alt=" Wkiol1xrdi-yrqmhaadq75kmbak319.jpg "/>

A summary of LVM learning

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.