Virtio Shrinkage Issue!

System specs at the bottom*

Okay, so I have been playing around with my VMs for a while now (KVM + virt-manager). And recently had to do the ‘qemu-img convert’ to control the crazy size issues (like 100GB+ drop in size per qcow due to bloat). So, this all happened while using virtio and the unmap feature for discard and zeroes.

So over the last week I’ve been watching and testing and finally saw the first signs of natural shrinkage (phrasing). But it only happened with the qcow for my linux vm set to ext4, using fstrim.

I attempted the same thing again using my Windows qcow passed into the linux VM, and though it returned a report of trimming 100GB+, the size didnt change (the same results I got from past trimming I did in windows VM).

Is there a problem with ntfs not wanting to zero free space with trimming or something? Or is it that ntfs and virtio don’t play nice together?

I will probably experiment later with changing from virtio to virtio-scsi to see if it makes any difference. (Made no difference at all) But I am very curious about what is going on, and if it is just me.

I know there are things like SDelete that will zero all the free space in Windows, but everyone is acting like semi-regular trimming should do the trick (which I now know it does in linux VM).

Also, I assume that SDelete throwing zeroes will hurt the SSDs I have my qcows on from the unnecessary writing (do let me know if I’m wrong about that).

Thanks for any help you can give me!

*System Specs:

Threadripper 1950X
64GB DDR4
1TB Corsair MP510 - ext4 - host OS
1TB SK Hynix P1 - ext4 - all the OS qcows
1TB Samsung 850 Evo - ext4 - secondary qcows
4x Other drives for other storage - all in ext4
Manjaro Cinnamon - Kernel 5.8
AMD RX580 8GB - host card
nVidia GTX1080 - passthrough card

VMs:

1x 50GB Endeavour OS - ext4 - Linux VM
2x 100GB Win10 2004 - ntfs - Win10 VM
1x 800GB Game storage - ntfs

Edited for update about further testing

So, I am noticing for my large ntfs (apparently somehow its actually ReFS) qcow, it is doing something weird.

It might actually be shrinking. The qcow never tells me a different size at all, however, the free space available on the host drive it’s on seemed to go up after I deleted some things from the qcow and trimmed again.

I havent seen this on the other qcow, but since there are multiple VMs on it, it is a little hard to notice like this one larger one.

So, I guess the problem is solved…kinda. I will continue testing things and see.

1 Like