qemu-discuss
[Top][All Lists]
Advanced

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

Re: qemu-img convert: Compression can not be disabled when converting fr


From: Talha Khan
Subject: Re: qemu-img convert: Compression can not be disabled when converting from .qcow2 to .raw
Date: Fri, 21 Jun 2024 20:35:29 +0530

Maybe try first
    qemu-img resize
then use qemu-img convert


On Fri, 21 Jun, 2024, 20:18 Sven Ott, <sven.ott@fau.de> wrote:
Hi, I want to mount a VM image to a loop device and give it some excess
space.

To do so, I download a .qcow2 file, add some 0 bytes with truncate, and
then convert the image from QCOW2 to RAW format with qemu-img convert,
like so:

```

GUEST_IMG=focal-server-cloudimg-amd64

wget https://cloud-images.ubuntu.com/focal/current/$GUEST_IMG

truncate -s 5G $GUEST_IMG.img

qemu-img convert -f qcow2 -O raw $GUEST_IMG.img $GUEST_IMG.raw

```

The problem is that the convert command throws away the 0-bytes which
have been appended earlier, leaving me with a .raw image of the original
size. As per the man page, the resulting image can be optionally
compressed with the -c flag, indicating that not providing said flag
would lead to an uncompressed resulting image.

I'm on Debian on x86_64; I've tried the qemu-img version 6.2 and 8.2
unsuccessfully so far.

Any help would be appreciated!

Sven




reply via email to

[Prev in Thread] Current Thread [Next in Thread]