查看扩容之前的磁盘状况
[root@localhost ~]# df -h [root@localhost ~]# fdisk -l
创建物理卷(PV)
#pvcreate /dev/sdc ---输入磁盘实际路径
格式化新硬盘
[root@localhost ~]# mkfs.ext4 /dev/sdc mke2fs 1.41.12 (17-May-2010) /dev/sda is entire device, not just one partition! Proceed anyway? (y,n) y ***询问是否继续,输入Y,确定
查看系统PV的情况:
[root@localhost ~]# pvdisplay --- NEW Physical volume --- PV Name /dev/sdc VG Name //新建的PV的VG name是空的,下一步就是把PV加入VG PV Size 15.00 GiB Allocatable NO ......
查看原VG的情况
[root@localhost ~]# vgdisplay --- Volume group --- VG Name VolGroup //注意记录此名字,扩容时将新的pv加入指定的名字 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 ......
扩展卷组,将/dev/sdc物理卷添加到VolGroup卷组中
[root@localhost ~]# vgextend VolGroup /dev/sdb Volume group "VolGroup" successfully extended
至此完成新硬盘扩展!
原文出处:delphixe -> http://www.delphixe.net/2017/10/14/%E7%AE%80%E8%BF%B0linux%E4%B8%8Blvm-%E7%A3%81%E7%9B%98%E6%89%A9%E5%AE%B9/