Linux base LVM

Source: Internet
Author: User

Create LVM 1.

Create a physical volume

Partition (logical partition | primary partition) PVCREATE/DEV/VDB1 PVCREATE/DEV/VDB2/DEV/VDB3

PVs Pvdisplay

2. Create a volume group Vgcreate vgtest/dev/vdb1/dev/vdb2/dev/vdb3 VGS Vgdisplay

3

. Create a logical Volume Lvcreate-n lvtest-l 400M vgtes

LVS Lvdisplay

Lvcreate-n lvkevin-l vgtest-l KMG Specifies size by the number of blocks

Lvcreate-n lvmark-l 100%free Vgtest

4. Create File system Mount Mkfs.ext4/dev/vgtest/lv1

Mkfs.ext4/dev/mapper/vgtest-lv1

Mount/dev/vgtest/lv1/mnt

PE size custom vgcreate-s 8M vgl/dev/vdb5 vgchange-s 2M Vgcarol

Extended 1.lv expansion (corresponding to VG space enough) lvextend-l 500m/dev/vgweb/lvweb to 500M lvextend-l +300m/dev/vgweb/lvweb-Extended 3 10,

2. File system extension Ext Resize2fs/dev/mapper/vgweb-lvweb

XFS Xfs_growfs/web

3.VG extension vgextend vgweb/dev/vdb9 lvextend-l 1.5g/dev/vgweb/lv1

Resize2fs/dev/mapper/vgweb-lvweb shrinking

    1. File system reduction XFS does not allow ext to umount/lvtest e2fsck-f/dev/mapper/vgweb-lv1

    2. Resize2fs/dev/mapper/vgweb-lvweb 800M

      . LV Narrowing lvreduce-l 800m/dev/vgweb/lvweb lvreduce-l -300m/dev/vgweb/lvweb lvreduce-f-l-200m/dev/vgweb/lvweb

    3. 3.VG Shrink vgreduce VGWEB/DEV/VDB9 Delete

    4. 1. Uninstalling Umount

    5. 2. Delete Lvlvremove-f/dev/vgcarol/lv1

    6. 3. Delete Vgremove Vgweb

    7. 4. Delete PVREMOVE/DEV/VDB9

    8. 5. Delete Partition Fdisk D


This article from the "11601463" blog, reproduced please contact the author!

Linux base 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.