[PVE-User] Info on qcow2 clone

Paul Gray gray at cs.uni.edu
Wed Oct 22 17:41:35 CEST 2014

On 10/22/2014 10:33 AM, Alessandro Briosi wrote:
> Hi all,
> don't know if this has been rised before.
> I have created a KVM with a qcow2 file (32G per default)
> Now if I look at the file on filesystem size is reported as 32GB, but at
> a closer look it's a sparse file so with a system inside using only 5GB,
> it's acqually using 5GB on the server (ls -ls)
> I suppose it's created with preallocation=metadata
> Though if I clone the VM the disk size of the cloned VM results to be
> using the whole 32GB of disk space (it's not a sparse file)
> Is this by design? I would expect that cloning a sparse qcow2 would
> create another sparse qcow2 file.
> Tests are on local storage btw.

A clone of cruft should contain cruft, so your report of filesizes above 
doesn't come as a surprise.

If you want a smaller footprint, I suggest using zerofree (linux) or 
SDelete (windows) to zero out unused sectors on the disk to make the 
compression of the non-used areas more effective.


More information about the pve-user mailing list