Expansion and reduction of LVM logical volumes

Source: Internet
Author: User


Logical volumes can be dynamically stretched online. To expand the space of a logical volume, you do not need to detach the file system. To stretch a logical volume, follow these steps: ensure that there is sufficient free space in the volume group: vgdisplay expands the specified logical volume space: lvextend-L + 10G/dev/linuxcast-vg/mylv Update file system: resize2fs/dev/linuxcast-vg/mylv view the updated file system: df-h
Stretch a volume group: www.2cto.com format the disk to be added to the volume group as a physical volume: pvcreate/dev/sdc Add the disk to the specified volume group: vgextend linuxcast-vg/dev/sdc view the Expanded size: The vgdisplay logical volume can be dynamically reduced. However, to scale down the logical volume offline, that is, detach it. Follow these steps to narrow down the logical volume:
Unmount the logical volume: umount/dev/lnuxcast-lv/mylv zoom out file system: resize2fs/dev/linuxcast-lv/mylv 10G zoom out logical volume size: lvreduce-L-5G/dev/linuxcast-lv/mylv after viewing the reduced size: lvdisplay mount: mount/dev/linuxcast-lv/mylv/mnt to narrow down a volume group: www.2cto.com remove a disk from a volume group: vgreduce linuxcast-lv/dev/sdc

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.