How to resize a qcow2 disk image on Linux - Linux Tutorials - Learn Linux Configuration

Qcow2 is the default virtual disk storage format used by Qemu (qcow stands for qemu copy-on-write). This image format makes use of thin provisioning, so, after we initially set the maximum virtual size of a disk, space is actually allocated only when used, but not made available back to the host when freed.In this article we see how to “sparsify” a qcow2 disk image to reclaim available space, how to expand it or shrink it, and how to manage the partitions layout on it from the host system, connecting it by using the NBD protocol.

This is a companion discussion topic for the original entry at

Package which provides virt-sparsify is libguestfs-tools. ( please change libguests-tools to libguestfs-tools)