Skip to content

Instantly share code, notes, and snippets.

@dephekt
Created October 6, 2017 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dephekt/b772852a83034ed88607f28e0ac38fb5 to your computer and use it in GitHub Desktop.
Save dephekt/b772852a83034ed88607f28e0ac38fb5 to your computer and use it in GitHub Desktop.
Growing extra space in qcow2 images

Double-check that you're dealing with the right image

qemu-img info filesystem.qcow2

Increase the image by (e.g.) 10GB

qemu-img resize filesystem.qcow2 +10G

Backup image since we can't resize an image in-place

cp filesystem.qcow2 filesystem-orig.qcow2

Expand the virtfs

virt-resize --expand /dev/sda[1,2,3] filesystem-orig.qcow2 filesystem.qcow2

Inspect the virtfs

virt-filesystems --long -h --all -a filesystem.qcow2

Source: https://fatmin.com/2016/12/20/how-to-resize-a-qcow2-image-and-filesystem-with-virt-resize/

Retrieved 6 Oct. 2017.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment