kvm client disk 扩容

Step 1: Shut down the VM
sudo virsh list
sudo virsh shutdown 主机名
sudo virsh list

Step 2: Extend guest OS disk
sudo virsh domblklist 主机名
sudo virsh dumpxml 主机名 | egrep 'disk type' -A 5
sudo qemu-img info /var/lib/libvirt/images/磁盘名.qcow2

Step 3: Extend guest VM disk
sudo qemu-img resize /var/lib/libvirt/images/磁盘名.qcow2 +10G
sudo qemu-img info /var/lib/libvirt/images/磁盘名.qcow2
sudo virsh start 主机名
sudo virsh blockresize 主机名 /var/lib/libvirt/images/磁盘名.qcow2 40G

extend root filesystem using LVM on Linux
lsblk
On Ubuntu / Debian system, run
sudo apt -y install cloud-guest-utils
For CentOS server, run
sudo yum -y install cloud-utils-growpart

sudo growpart /dev/vda 3
sudo pvresize /dev/vda3
sudo pvs
sudo vgs
df -hT
sudo lvextend -l +100%FREE /dev/name-of-volume-group/root

For ext4 filesystem
sudo resize2fs /dev/name-of-volume-group/root
For xfs filesystem
sudo xfs_growfs /

标签: none

添加新评论