[libvirt-users] virt-sparsify changing the apparent-size of files

Andrea Bolognani abologna at redhat.com
Thu Jun 23 07:39:52 UTC 2016


On Wed, 2016-06-22 at 17:56 -0500, libvirt_users at skagitattic.com wrote:
> If we try it again but specify raw its MUCH faster
> 
>     root at testingbox: 09:26 PM # virt-sparsify testimage.qcow2
>     testimage2.qcow2 --tmp /bigtmp --format raw Input disk virtual size
>     = 53687091200 bytes (50.0G) Create overlay file in /bigtmp to
>     protect source disk ... Examine source disk ...
>     Copy to destination and make sparse ...
> 
>     Sparsify operation completed with no errors.  Before deleting the
>     old disk, carefully check that the target disk boots and works
>     correctly. 
>     root at testingbox: 09:27 PM #
> 
> This time it takes up more space and reports real and apparent size
> differently.  It still reports as qcow2 with qemu-img.
> 
>     # ls -slh testimage2.qcow2 
>     1.7G -rw-r--r-- 1 root root 51G Jun 22 21:27 testimage2.qcow2
>     # qemu-img info testimage2.qcow2
>     image: testimage2.qcow2
>     file format: qcow2
>     virtual size: 50G (53687091200 bytes)
>     disk size: 1.7G
>     cluster_size: 65536
>     Format specific information:
>         compat: 1.1
>         lazy refcounts: true

The '--format' option is to specify the image format for the
input image. If you want the *output* image to be raw, you'll
have to use '--convert raw'.

-- Andrea Bolognani / Red Hat / Virtualization




More information about the libvirt-users mailing list