Extend the disk size of a Debian qcow2
Recently I am working on a project requiring me to pack some QEMU images for the CI purpose. As it’s going be a VM which requires almost no changes after it’s configured, I was hoping to minimize it as much as possible. The OS image I need to use is the Debian 12 image from the official Debian release repo.
The softwares I installed required some disk space around 2G, which is more than the original disk space the image initially configured, so I decided to extend the disk to allocate more space directly as I really don’t want to create an extra img file for this work.