Goal:
Expansion of the KVM VM root disk from 80G to 400G
Operation:
1. View Current Disk information
[Email protected] centos-yum]# qemu-img info centos-yum.qcow2image:centos-yum.qcow2file format:qcow2virtual size:80g (85899345920 bytes) disk size:2.1gcluster_size:65536
2. View partition and File system Information
[Email protected] centos-yum]# virt-list-partitions centos-yum.qcow2/dev/sda1/dev/sda2[[email protected] Centos-yum ]# Virt-list-filesystems Centos-yum.qcow2/dev/sda1/dev/vg_centos65templ/lv_root
3. Create a new Qcow2 disk file with a size of 400G
Qemu-img create-f qcow2 Centos-yumroot.qcow2 400G
4. Expand the disk size
[[email protected] Centos-yum] #virt-resize--expand/dev/sda2--lv-expand/dev/vg_centos65templ/lv_root Centos-yum.qcow2 centos-yumroot.qcow2 .... Expanding/dev/sda2 using the ' pvresize ' method ... Expanding/dev/vg_centos65templ/lv_root using the ' resize2fs ' method ... Resize operation completed with no errors. Before deleting the old disk, carefully check the resized disk boots and works correctly.
KVM Resize Disk size