您的位置:首页 > 其它

KVM resize磁盘大小

2015-11-23 12:58 253 查看

目标:

将kvm虚机的root disk从80G扩充到400G

操作:

1、查看当前磁盘信息
[root@kvm01 centos-yum]# qemu-img info centos-yum.qcow2
image: centos-yum.qcow2
file format: qcow2
virtual size: 80G (85899345920 bytes)
disk size: 2.1G
cluster_size: 65536


2、查看分区及文件系统信息
[root@kvm01 centos-yum]# virt-list-partitions centos-yum.qcow2
/dev/sda1
/dev/sda2
[root@kvm01 centos-yum]# virt-list-filesystems centos-yum.qcow2
/dev/sda1
/dev/vg_centos65templ/lv_root


3、创建一个新的qcow2磁盘文件,大小为400G
qemu-img create -f qcow2 centos-yumroot.qcow2 400G
4、扩充磁盘大小
[root@kvm01 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 that the resized disk boots and works correctly.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  kvm