Capacity to scale logical volumes in Linux

Source: Internet
Author: User

First, before the expansion, look at their own logical volume, Volume group, Physical Volume Information: (On the basis of the previous article: the creation of logical volumes in Linux)

To view a physical volume:

# PVDISPLAY/DEV/SDC1

To view a volume group:

Vgdisplay/dev/zhi

To view a logical volume:

Lvdisplay/dev/zhi/lv-zhi

Second, the expansion of the logical volume

Now I'm going to add 2G to the logical volume/dev/zhi/lv-zhi: (If it's reduced, change to a minus)

Lvextend-l +2g/dev/zhi/lv-zhi

After the increase is complete, re-identify:

Resize2fs/dev/zhi/lv-zhi

 

Attention:

My logical volume file system is EXT4 so use RESIZE2FS to identify, if you are XFS file system, you should be using:

Xfs_growfs/dev/zhi/lv-zhi

To re-view the logical Volume information:

Third, the volume group expansion

Now I'm going to add 5G to the logical volume, but now there's only 2G of space left in the volume group. So you need to scale up the volume group and then scale the logical volume

1. New Partition 5G:

Fdisk/dev/sdc

  

2. Kernel re-recognition

Partprobe/dev/sdc

3. Create a physical volume

 

Pvcreate/dev/sdc2

4. Adding volume groups

Vgextend ZHI/DEV/SDC2

  

View the VG information:

5. Increase the size of the logical volume:

  

6. Re-refresh

Resize2fs  

To view information for a logical volume:

Copyright

Feiquan

Source: http://www.cnblogs.com/feiquan/

Copyright NOTICE: This article copyright belongs to the author and the blog Park is shared, welcome reprint, but without the consent of the author must retain this paragraph statement, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.

It is not easy to write the text, please respect the fruits of labor ~ Thank you all here (*/ω\*)

Capacity to scale logical volumes in Linux

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.