Am 21.05.25 um 17:32 schrieb Eric Blake:
> On Wed, May 21, 2025 at 11:54:03AM +0200, Fiona Ebner wrote:
>> I also tried it on my host, where the filesystem is ZFS using
>> compression, and there, 'du' will already report a lower value after
>> creating the image, because of compression. And even without compression
>> it seems that preallocation=full on ZFS is somehow async :/
>>
>>> [I] febner@enia ~/qemu/build/tests/qemu-iotests (master)> qemu-img create 
>>> my.raw 20M -f raw -o preallocation=full
>>> Formatting 'my.raw', fmt=raw size=20971520 preallocation=full
>>> [I] febner@enia ~/qemu/build/tests/qemu-iotests (master)> du --block-size=1 
>>> my.raw
>>> 512 my.raw
>>> [I] febner@enia ~/qemu/build/tests/qemu-iotests (master)> du --block-size=1 
>>> my.raw
>>> 20980224    my.raw
> 
> That one may be a bit harder to work around, but I'll give it a shot
> while I'm patching the first one.

FWIW, doing a 'sync' before querying with 'du' will avoid the issue for
the allocation. But even then, after mirroring, the file will be sparse
again.

Best Regards,
Fiona


Reply via email to