LVM Logical Volume Management

Source: Internet
Author: User

LVM: Logical Volume Manager (Logical Volume Manager)

Combine multiple physical disk partitions (PVS) into large volume groups (VG), and then partition the required size from the large volume group (LV)

    • PV (physical Volume, physical volume)

    • VG (Volume Group, Volume group)

    • PE (physical Extend, physical expansion block): PE is the minimum storage block for LVM, a bit like the file system block

    • LV (Logical Volume, Logic extension block): System ID = 8e

Characteristics

    • Dynamically adjust file system size, add capacity on demand

    • Support for snapshot backups

implementation Process :

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/C3/wKioL1WGs1KhN2XuAABdgbEE9VM134.jpg "style=" float: none; "title=" Image.png "alt=" Wkiol1wgs1khn2xuaabdgbee9vm134.jpg "/>

Create, modify, close steps

1:PV

    • pvcreate/dev/sda{7,8,9}

    • View: Pvscan Pvdisplay//Legend is just an example

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/C6/wKiom1WGsZzAIRgIAAFW0jcpMrM254.jpg "style=" float: none; "title=" Image2.png "alt=" Wkiom1wgszzairgiaafw0jcpmrm254.jpg "/>

2:VG

    • vgcreate [-S definition pe size] VG group name/dev/sda{7,8,9}

    • View Vgscan, Vgdisplay

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6E/C3/wKioL1WGs1LAwN1gAAHEJXOY0PQ902.jpg "title=" Image3.png "style=" Float:none; "alt=" wkiol1wgs1lawn1gaahejxoy0pq902.jpg "/>

3 Increase/Decrease PV amount in VG:

    • Vgextend/vgreduce VG Group name PV

Delete VG:

    • Vgremove

3:LV

    • Lvcreate [-L allocated PE number] [-l allocated size, must be an integer multiple of PE size]-n LV name VG name

    • Lvdisplay

4: format the LV, and mount the use

    • LV Device Name and directory example:/DEV/BOXINVG/BOXINLV or/DEV/MAPPER/BOXINVG-BOXINLV

5: zoom in on LV and file system capacity

    • Lvresize [-L +/-increase/decrease PE number] [-l +/-increase/decrease size] Device

    • You can use the lvdisply command to see that the LV is increased but the file system does not grow

    • RESIZE2FS [Device]//Dynamic Extended file system capacity to the same as LV, if added file size, expand to the specified size

6: reduce LV and file system capacity

    • Reduce file system size first

1: Uninstall

2: Disk check e2fsck-f [device]

3: Shrink file system resize2fs [device] [size]

    • Finally zoom out LV

7: Remove LV

    • First take advantage of Pvmove [LV to remove] [others can accommodate LV to remove the number of PE in LV]//PE transfer of LV to be removed

    • Vgreduce VG Group [LV to remove]//Removed from VG

    • pvremove [LV to remove]

8: Turn off LVM

    • Uninstall all LVM file systems first

    • Lvremove Delete LV

    • Vgchange-an vgname//Let VG not have active flag, equivalent to shutdown

    • Vgremove Delete VG

    • Pvremove removing PV

    • Delete the partition, or change the system ID back to 82 later use


This article is from the "Call Me boxin" blog, so be sure to keep this source http://boxinknown.blog.51cto.com/10435935/1664037

LVM Logical Volume Management

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.