{"id":7459,"date":"2014-06-19T03:59:24","date_gmt":"2014-06-19T03:59:24","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/19\/free-up-not-used-space-on-a-qcow2-image-file-on-kvm-qemu-collection-of-common-programming-errors\/"},"modified":"2014-06-19T03:59:24","modified_gmt":"2014-06-19T03:59:24","slug":"free-up-not-used-space-on-a-qcow2-image-file-on-kvm-qemu-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/19\/free-up-not-used-space-on-a-qcow2-image-file-on-kvm-qemu-collection-of-common-programming-errors\/","title":{"rendered":"free up not used space on a qcow2-image-file on kvm\/qemu-Collection of common programming errors"},"content":{"rendered":"<p>we are using kvm\/qemu with qcow2-images for our virtual machines.<\/p>\n<p>qcow2 has this nice feature where the image file only allocates the actually needed space by the virtual-machine. but how do i shrink back the image file, if the virtual machine&#8217;s allocated space gets smaller?<\/p>\n<p>example:<\/p>\n<p>1.) i create a new image with qcow2 format, size 100GB<\/p>\n<p>2.) i use this image to install ubuntu. installation needs about 10 gb, the image-file grows up to about 10GB. nothing unexpected so far.<\/p>\n<p>3.) i fill up the image with about 40 GB of additional data. the image-file grows up to 50GB. i am ok with that \ud83d\ude42<\/p>\n<p>4.) this is where it gets strange: i delete all of the 40GB data on the image, but the image-size still eats up 50GB.<\/p>\n<p>question: how do i free up that 40GB of data and shrink the image to the only needed 10 GB?<\/p>\n<p>thanks in advance, berni<\/p>\n","protected":false},"excerpt":{"rendered":"<p>we are using kvm\/qemu with qcow2-images for our virtual machines. qcow2 has this nice feature where the image file only allocates the actually needed space by the virtual-machine. but how do i shrink back the image file, if the virtual machine&#8217;s allocated space gets smaller? example: 1.) i create a new image with qcow2 format, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7459","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7459"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7459\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}