Re: ATA Trim for qcow(2)
From: Matthew Palmer <hidden>
Date: 2011-01-23 23:33:29
On Sun, Jan 23, 2011 at 10:35:45PM +0100, Emil Langrock wrote:
there is support for ext4 to use the trim ATA command when a block is freed. I read that there should be an extra command which does that freeing afterwards. So is it possible to use that information inside the qcow to mark those sectors as free? This would make it possible to shrink the size of an image significantly using some offline (maybe also some online) tools.
If the qemu block device can write zeroes out to TRIMmed space, a simple cp --sparse=always <file> <file> (on a raw image) can save all that zeroed space; I recall looking into this sort of thing a while ago and it was fairly simple to write a tool to wipe out the zero blocks in a qcow2 file, too. - Matt -- "The user-friendly computer is a red herring. The user-friendliness of a book just makes it easier to turn pages. There's nothing user-friendly about learning to read." -- Alan Kay