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