这是目前的磁盘情况
我查看了一下磁盘/dev/sda还有空余的空间
这种情况下,我只需要扩展vg的容量,然后给lv扩容即可,首先进行/dev/sda的磁盘分区,记得把新分的区改成8e[root@centos7 ~]# fdisk /dev/sda [root@centos7 ~]# partprobe /dev/sda #使kernel重新读取分区 信息,从而避免重启系统。再次查看,发现已经分区了一块5G大小的空间
创建pv[root@centos7 ~]# pvcreate /dev/sda3 Physical volume "/dev/sda3" successfully created.扩展vg,首先先查看一下vg的信息,以免出错[root@centos7 ~]# vgs VG #PV #LV #SN Attr VSize VFree centos 1 3 0 wz--n- 12.00g 4.00m [root@centos7 ~]# vgextend centos /dev/sda3 Volume group "centos" successfully extended [root@centos7 ~]# vgs VG #PV #LV #SN Attr VSize VFree centos 2 3 0 wz--n- 17.00g 5.00g扩展lv,让lv的大小增加5G[root@centos7 ~]# lvextend -L +5G /dev/mapper/centos-root Size of logical volume centos/root changed from 5.00 GiB (1280 extents) to 10.00 GiB (2560 extents). Logical volume centos/root successfully resized. [root@centos7 ~]# xfs_growfs /dev/mapper/centos-root # 命令使系统重新读取大小 meta-data=/dev/mapper/centos-root isize=512 agcount=4, agsize=327680 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 f