-   Linux - Software (
-   -   qemu, qcow2 -> hard disk (

qrange 05-22-2011 10:45 AM

qemu, qcow2 -> hard disk
is there a way to write/unpack .qcow2 hard disk image directly to real hard drive in Linux?

(I know it's possible to unpack .qcow2 to .raw and then dd to drive, but I'd like to skip .raw since its large)

jefro 05-22-2011 12:50 PM

I'd boot the image to qemu an dd it or clonezilla/tar/cp it to some place.

While in qemu you could blank free space to reduce expanded size.

It might be possible to use qemuimage then port the output to someplace but I never did it or heard of it.

qrange 05-22-2011 03:02 PM

it seems very hard to access the physical drive directly from qemu. besides its extremely sloow (qemu-sparc).

I already did wipe free space, so qcow2 image is quite small.
would be nice to pipe qemu-img output directly to dd, is that possible?

edit: I tried this as a test:
qemu-img convert -O raw /home/debian/qemuimage.qcow2 |dd of=test

however it didn't work. the problem is in qemu-img, how to redirect its output?
dd seems to accept piping just fine

edit2: it seems they will never add that feature: :(

ZT13 05-02-2013 12:25 AM

You might want to try qemu-img convert -O raw diskimage.qcow2 /dev/mydevice

All times are GMT -5. The time now is 04:27 AM.