Re: Convert one .img disk created with sparse=true to no sparse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011-10-20, 13:21(+02), Gonzalo Marcote Peña:
> 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?.
> Thank you.
[...]

You'll have to make a separate copy anyway as your aim is to
have all the data contiguous on disk.

If it's a raw image.

cat < old.img > new.img

cp --sparse=never old.img new.img

Or you can use qemu-img convert.

Or you could use a LVM volume instead of file. This way, you
have more control on which sectors are allocated and can force
them to be contiguous.

On extent based FS (ext4, btrfs...), there might be a way to
guarantee as few extents as possible, but I don't know it.

-- 
Stephane

--
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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux