From 8df219790565a15e6a3d1064a2383e11b02a3c4d Mon Sep 17 00:00:00 2001 From: Kalpesh Lad Date: Tue, 29 Aug 2023 21:18:41 -0400 Subject: [PATCH] Use writeback rather then the default writethrough for compression --- qemu/chroot/step_compress_image.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu/chroot/step_compress_image.go b/qemu/chroot/step_compress_image.go index eccd3f2..5cf3b1d 100644 --- a/qemu/chroot/step_compress_image.go +++ b/qemu/chroot/step_compress_image.go @@ -29,7 +29,7 @@ func (s *StepCompressImage) Run(_ context.Context, state multistep.StateBag) mul ui.Say("Compressing image...") tmpPath := imagePath + ".tmp" - cmd := fmt.Sprintf("qemu-img convert -c -O qcow2 %s %s", imagePath, tmpPath) + cmd := fmt.Sprintf("qemu-img convert -c -t writeback -O qcow2 %s %s", imagePath, tmpPath) cmd, err := wrappedCommand(cmd) if err != nil { err := fmt.Errorf("Error creating compression command: %s", err)