1、关闭虚拟机,手动进行磁盘扩容
2、输入扩展的大小,点击保存,然后重启虚拟机
3、输入df -h 查看文件系统内存使用,发现并没有扩容
4、输入 fdisk -l 查看系统磁盘大小
发现系统磁盘已扩容,但还没进行分配,需执行下面操作,完成建立分区、格式化、文件属性、分配;
5、为新增的磁盘创建分区
[root@localhost ~]#fdisk /dev/sda
5.1 输入 n
5.2 输入 p
5.3 输入 3 ,然后回车
5.4 输入 w 保存
6、将创建好的分区格式修改
[root@localhost ~]#fdisk /dev/sda
使用fdisk -l 查看新建分区
7、格式化磁盘
[root@localhost ~]# mkfs -t ext3 /dev/sda3
8、将物理磁盘转为物理卷PV,扩展VG
[root@localhost ~]# pvcreate /dev/sda3 // cl 为/dev/mappper/cl-root 的组名, [root@localhost ~]# vgextend cl /dev/sda3
9、扩展文件系统
[root@localhost ~]# vgdisplay [root@localhost ~]# lvextend -l +100%FREE /dev/mapper/cl-root [root@localhost ~]# xfs_growfs /dev/cl/root
10、查看扩充后结果 df -h



