Thank you Stefan. That's exactly what i needed. I worked perfectly. 2011/10/20 Simon Wilson <simon@xxxxxxxxxxxxxxxx>: > ----- Message from Stefan Hajnoczi <stefanha@xxxxxxxxx> --------- > Date: Thu, 20 Oct 2011 07:43:45 -0700 > From: Stefan Hajnoczi <stefanha@xxxxxxxxx> > Subject: Re: Convert one .img disk created with sparse=true to no sparse > To: Gonzalo Marcote Peña <gonzalomarcote@xxxxxxxxx> > Cc: kvm@xxxxxxxxxxxxxxx > > >> On Thu, Oct 20, 2011 at 4:21 AM, Gonzalo Marcote Peña >> <gonzalomarcote@xxxxxxxxx> 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 majordomo@xxxxxxxxxxxxxxx >> More majordomo info at http://vger.kernel.org/majordomo-info.html > > > ----- End message from Stefan Hajnoczi <stefanha@xxxxxxxxx> ----- > > 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 majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html