just notes

virt-sparsify –inplace


Use to make a qcow2 disk remove empty space

Make sure the guest is compatible, and shutdown, if the disk is for a vm. Windows should be by default.

Check with this command, in cmd or PowerShell:

from https://pve.proxmox.com/wiki/Shrink_Qcow2_Disk_Files#Windows_Guest_Preparation
fsutil behavior query DisableDeleteNotify

# and this to change if it's not set to 0.

fsutil behavior set DisableDeleteNotify 0
in the host

#> virt-sparsify --in-place disk.qcow2

The above example is a disk formatted with ntfs/fat etc..

Other helpful info, verifying the sparse sizes.

#> du -h <file>
#> du -h  --apparent-size <file>

# https://wiki.archlinux.org/title/Sparse_file

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.