System Management

A KVM guest's qcow2 disk image, disk.qcow2, has a virtual size of 20 GiB. The guest is powered off and the root filesystem is nearly full. The administrator wants the virtual disk to be 30 GiB in total, keeping all existing data. Which command does this?

Show the answer

Correct answerB. qemu-img resize disk.qcow2 +10G

qemu-img resize with a +10G offset adds 10 GiB to the current 20 GiB virtual size, giving 30 GiB. A plain 10G sets the absolute size to 10 GiB, which is a shrink that qemu-img refuses without --shrink and would risk data loss. Convert only copies the image or changes its format and keeps the 20 GiB size. The guest partition and filesystem must still be grown afterward.