CentOS Logical Volume Usage

Source: Internet
Author: User

Requirements : 1. Hard disk format into physical volume PVPVCREATE/DEV/SDB/DEV/SDA

2. Create Volume group vgcreatevg1000/dev/sdb1/dev/sdb2# Create Volume Group "vg1000"

3. Increase the volume group capacity vgextendvg2000/dev/sdb2# The physical volume "/DEV/SDB2" into the volume group "vg2000"

4. Reduce VGREDUCEVG2000/DEV/SDB2

5. Delete vgremovevg1000

6. Conversion format vgchange-anvg1000# Set the volume group status to inactive vgconvert-m2v

  • 1. Hard disk format into physical volume PV
    Pvcreate/dev/sdb/dev/sda
    2. Create a volume group
    Vgcreate vg1000/dev/sdb1/dev/sdb2 #创建卷组 "vg1000"
    3. Increase Volume Group capacity
    Vgextend vg2000/dev/sdb2 #将物理卷 "/DEV/SDB2" into the volume group "vg2000"
    4. Reduce
    Vgreduce VG2000/DEV/SDB2
    5. Delete
    Vgremove vg1000
    6. Conversion format
    Vgchange-an vg1000 #设置卷组状态为非活动状态
    vgconvert-m2 vg1000 #转换卷组为 "LVM2" format
    vgconvert-m2 vg1000 #转换卷组为 "LVM2" format Volume group vg1000 successfully converted
    Vgchange-ay vg1000 #设置卷组状态为活动状态 0 Logical Volume (s) in volume group ' vg1000 ' now active

    1. Creating a logical Volume
    Lvcreate-n mylv-l 2G Xiaoluo #-N name-l Size
    2. Expansion
    Lvextend-l +1G/DEV/XIAOLUO/MYLV
    Resize2fs/dev/xiaoluo/mylv

    Narrow
    RESIZE2FS/DEV/XIAOLUO/MYLV 10G//The purpose of this command is to narrow down our filesystem and reduce our file system to 10G
    E2fsck-f/DEV/XIAOLUO/MYLV//Use the E2FSCK command to check our file system
    Vreduce-l -4g/dev/xiaoluo/mylv//Shrink 4G-sized logical volumes

CentOS Logical Volume Usage

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.