LVM逻辑卷扩容
作者:linux120 发布时间:May 28, 2015 分类:服务器配置
首先通过pvs和vgs了解一下物理和逻辑磁盘组
[root@Linux120.com ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vg00 1 3 0 wz--n- 925.51g 913.51g
然后通过lvs查看当前物理组的逻辑卷分配情况
[root@Linux120.com ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home vg00 -wi-ao---- 4.00g
usr vg00 -wi-ao---- 4.00g
var vg00 -wi-ao---- 4.00g
比如要把home分区从4G拓展为40G执行lvresize -L 40960M /dev/vg00/home
[root@Linux120.com ~]# lvresize -L 40960M /dev/vg00/home
Size of logical volume vg00/home changed from 4.00 GiB (1024 extents) to 40.00 GiB (10240 extents).
Logical volume home successfully resized
可以看到成功扩容。
然后通过resize2fs /dev/vg00/home重新校对该分区即可。
[root@Linux120.com ~]#
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/vg00/home is mounted on /home; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 3
Performing an on-line resize of /dev/vg00/home to 10485760 (4k) blocks.
The filesystem on /dev/vg00/home is now 10485760 blocks long.