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-usin...
http://dustymabe.com/2013/06/26/enabling-qemu-guest-agent-anddddd-fstrim-...
Unfortunately, after stopping the VM, editing the config file to add
"discard=unmap" and booting the VM again, fstrim does not work:
fstrim: /: the discard operation is not supported
The doc cited above says the feature needs virtio-scsi so I modified the
guest parameters using virt-manager to set virtio-scsi instead of virtio
serial.
I don't know how to set "discard="unmap" with virt-manager. Is it
possible?
I can modify the .xml file using vi, but I'd rather stick to
virt-manager if possible, for me and my colleagues. However, for those
tests, I diff the .xml file everytime to check what happens underneath.
Once virtio-scsi is used, whether or not I set "discard="unmap" (through
manually .xml file edition), as long as virtio-scsi is specified, the
fstrim command works or seems to:
#fstrim -v /
/: 1.3 GiB (1372569600 bytes) trimmed
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?
Thanks.
--
Jérôme