# 先停止虚拟机
virsh stop test-server-1
# 修改磁盘镜像大小
qemu-img resize test-server-data +100G
![](https://static.hessian.cn/wp-content/uploads/2022/03/image-1-1024x406.png)
# 进入虚拟机后pvresize
pvresize -v /dev/vdb
![](https://static.hessian.cn/wp-content/uploads/2022/03/image-2-1024x376.png)
![](https://static.hessian.cn/wp-content/uploads/2022/03/image-1024x229.png)
# 扩展lv空间
lvextend -l +100%FREE /dev/mapper/vgdata-data
![](https://static.hessian.cn/wp-content/uploads/2022/03/image-3-1024x388.png)
# 调整文件系统大小,这里是ext4的文件系统,用resize2fs,在此之前还需要先执行e2fsck
e2fsck -f /dev/mapper/vgdata-data
resize2fs /dev/mapper/vgdata-data
![](https://static.hessian.cn/wp-content/uploads/2022/03/image-4-1024x293.png)
# 最后挂载磁盘
mount -a
![](https://static.hessian.cn/wp-content/uploads/2022/03/image-5-1024x310.png)
完成
Read: 267