----- Message from Stefan Hajnoczi <stefa...@gmail.com> ---------
   Date: Thu, 20 Oct 2011 07:43:45 -0700
   From: Stefan Hajnoczi <stefa...@gmail.com>
Subject: Re: Convert one .img disk created with sparse=true to no sparse
     To: Gonzalo Marcote Peña <gonzalomarc...@gmail.com>
     Cc: kvm@vger.kernel.org


On Thu, Oct 20, 2011 at 4:21 AM, Gonzalo Marcote Peña
<gonzalomarc...@gmail.com> wrote:
Hi.
I have one guest that I created with virt-install comand option 'sparse=true'.
As i want to use now this guest for I/O tasks (DDBB) and i want to
improve performance, I want to convert the disk.img from sparse to no
sparse (obviusly without format it).
How can I do this task without loosinf the disk image data?.

If you are using a raw image file:
$ cp --sparse=never old-sparse.img new-allocated.img

This copies the data into the new file and does not try to make zero
regions sparse.  You can then replace the old file with the new file.

Stefan
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


----- End message from Stefan Hajnoczi <stefa...@gmail.com> -----

If working with a NON-sparse VM img (i.e. originally created with virt-install --nonsparse), does a cp without --sparse=never retain the non-sparse nature of the file, or does it have to be specified?

Simon

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to