[libvirt-users] Questions about qcow2 file size management

Eric Blake eblake at redhat.com
Wed Dec 16 23:38:49 UTC 2015


[Just now noticing this thread]

On 10/14/2015 08:43 AM, Jérôme wrote:
> Le 2015-10-14 13:27, Jérôme a écrit :
> 
>>> TRIM is needed to indicate that space is reclaimable. This needs file
>>> system support (no fat32, e.g.), and support by QEMU('s I/O driver).
>>> Once Qemu is set up to accept TRIM, you can either enable the discard
>>> mount option, or set up an fstrim cron job.
> 
> Thanks. I read stuff about that and it's becoming clearer now. 
> 
> These pages are the most complete explanations I found:
> http://dustymabe.com/2013/06/11/recover-space-from-vm-disk-images-by-using-discardfstrim/
> http://dustymabe.com/2013/06/26/enabling-qemu-guest-agent-anddddd-fstrim-again/

> However, in any case, I don't see any change in the space used by the VM
> file as seen from the host. It does not shrink.
> 
> Anything else I should do?
> 
> Anything I could check?

You should really look into using 'virt-resize' and 'virt-sparsify',
both part of the libguestfs tools suite, because they make this job a
LOT less error-prone and automatable.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20151216/2ece21ab/attachment.sig>


More information about the libvirt-users mailing list