Posts from the ‘KVM/QEMU’ Category

kvmbanner-logo2

Truncate KVM/QEMU Raw Disk Image

Most modern filesystems allow you to create virtual disk files without pre-allocating disk space. These virtual disks grow in size as the space is needed. The default virtual disk image type in KVM/QEMU is a sparse “raw” disk image which consumes real disk space as files are added. Interestingly, when files are deleted the virtual disk does not shrink. This makes sense as deleting files from a filesystem doesn’t typically erase the data but only the reference to where the data is stored on the disk. What follows is a recipe to reclaim this disk space. Read moreRead more