I have a 15G qcow2 xp vm with only 1 partition:
-rw-------. 1 root root 10514137088 Sep 12 11:10 XP.img
I want to resize it to 20G. So I :
virsh vol-create-as --format raw windows XP-new-20G.img 20G
Vol XP-new-20G.img created
-rw-------. 1 root root 21474836480 Sep 12 13:17 XP-new-20G.img
But:
virt-resize --expand /dev/sda1 XP.img XP-new-20G.img
Summary of changes:
/dev/sda1: partition will be resized from 14.6G to 20.0G
/dev/sda1: content will be expanded using the 'ntfsresize' method
part_add: do_part_add: parted: /dev/vdb: Error: The location 41938815s
is outside of the device /dev/vdb. at /usr/bin/virt-resize line 1092.
Do I use guestfs to do this?
BTW, I originally formatted the new vm as qcow2, but virt-resize
doesn't recognize it can expand a qcow2 vm:
virt-resize --expand /dev/sda1 XP.img XP-new-20G.img
virt-resize: XP-new-20G.img: file is too small to be a disk image (262144 bytes)
Thanks,
sean