[virt-tools-list] sparse files and ls
Richard W.M. Jones
rjones at redhat.com
Tue Jun 14 12:02:26 UTC 2011
On Tue, Jun 14, 2011 at 11:53:32AM +0100, Paul Mansfield wrote:
> On 08/06/11 17:53, Gary Scarborough wrote:
> > I guess the difference is that on the qcow2 files, the full(maximum)
> > size is not showing up.
> >
> > qemu-img info junk.img shows:
> >
> > image: junk.img
> > file format: qcow2
> > virtual size: 10G (10737418240 bytes)
> > disk size: 140K
> > cluster_size: 65536
>
> I would guess the "disk size" is the contained file system, not
> including the qcow2 "wrapper" overhead
>
> > ls -lash junk.img shows:
> >
> > 140K -rw-r--r-- 1 root root 193K Jun 8 11:11 junk.img
>
> so the overhead of qcow2 container is ?53K. does this grow as the
> virtual disk fills up?
qcow2 uses a two-level directory. The second level is not allocated
until required unless you selected the "preallocation" option when
creating the disk. So if you didn't use "-o preallocation" then yes
this overhead can grow as more disk blocks get allocated. By the way,
we found that preallocation is faster.
Mark wrote extensive documentation on qcow2 here:
http://people.gnome.org/~markmc/qcow-image-format.html
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v
More information about the virt-tools-list
mailing list