[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:emulators:kvm_libvirt_qemu_quirks_tips_etc [2023/11/05 20:46 (UTC)] – another section added zeebrahowtos:emulators:kvm_libvirt_qemu_quirks_tips_etc [2023/11/05 20:50 (UTC)] (current) – [QEMU QCOW2 freed virtual disk space doesn't shrink image] zeebra
Line 45: Line 45:
 === How to manually shrink the QCOW2 image to reflect the content on the virtual disk image === === How to manually shrink the QCOW2 image to reflect the content on the virtual disk image ===
  
-1. Inside the virtual machine, write zeroes to a file until the disk is full+1. Inside the virtual machine, write zeroes to a file until the virtual disk is full. In a terminal:
 <code> <code>
 dd if=/dev/zero of=/some/file dd if=/dev/zero of=/some/file
Line 53: Line 53:
 3. Shut down the virtual machine 3. Shut down the virtual machine
  
-4. You can use the convert image function to basically move the current image into a new image (convert from qcow2 to qcow2), and it will reflect the actual size of content (disregard zeroes)+4. You can use the convert image function to basically move the current image into a new image (convert from qcow2 to qcow2), and it will reflect the actual size of content (throw away zeroes). In a terminal:
 <code> <code>
 qemu-img convert -O qcow2 oldimage.qcow2 newimage.qcow2 qemu-img convert -O qcow2 oldimage.qcow2 newimage.qcow2
 howtos:emulators:kvm_libvirt_qemu_quirks_tips_etc ()