On 10/09/2014 05:17 AM, Zhang Haoyu wrote:
> Hi,
> I encounter a problem that after deleting snaptshot, the qcow2 image size is 
> very larger than that it should be displayed by ls command, 
> but the virtual disk size is okay via qemu-img info.
> I suspect that during updating l1 table offset, other I/O job reference the 
> big-endian l1 table offset (very large value), so the file is truncated to 
> very large.

Not quite.  Rather, all the data that the snapshot used to occupy is
still consuming holes in the file; the maximum offset of the file is
still unchanged, even if the file is no longer using as many referenced
clusters.  Recent changes have gone in to sparsify the file when
possible (punching holes if your kernel and file system is new enough to
support that), so that it is not consuming the amount of disk space that
a mere ls reports.  But if what you are asking for is a way to compact
the file back down, then you'll need to submit a patch.  The idea of
having an online defragmenter for qcow2 files has been kicked around
before, but it is complex enough that no one has attempted a patch yet.

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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to