Comment 1 for bug 783062

Revision history for this message
Abbakus (abbakus) wrote :

First solution (quick and dirty)
--------------
dd if=/dev/deviceN of=/path/to/different/device/image.raw bs=1024 conv=notrunc,noerror
qemu-img convert -c -f raw -O qcow2 /path/to/different/device/image.raw /local/machine/image.qcow2
rm /path/to/different/device/image.raw
-------> ~Duplicate time and temporary space. A different local device is needed.

Second solution
--------------
mkfifo /tmp/tempfifo
dd if=/dev/deviceN of=/tmp/tempfifo bs=1024 conv=notrunc,noerror&
qemu-img convert -c -f raw -O qcow2 /tmp/tempfifo /path/to/different/device/image.qcow2
rm /tmp/tempfifo
---------> Does not work, qemu-img does not support fifo :-(

Third solution
--------------
modprobe nbd
qemu-nbd -c /dev/nbd0 /path/to/different/device/image.qcow2
partprobe /dev/nbd0
dd if=/dev/deviceN of=/dev/nbd0 conv=notrunc,noerror
qemu-nbd -d /dev/nbd0
----> Works but is pretty slow and nbd module is needed. No duplicate space to obtain qcow2 format.

Fifth solution
--------------
dd if=/dev/deviceN bs=2048 conv=notrunc,noerror|gzip|ssh remoteuser@remotemachine "cut - | gunzip | dd of=/path/to/image/image.raw bs=2048 conv=notrunc,noerror"
------> Slow but a different local device is not needed. I tried this one and works pretty good :)

Sixth solution
---------
combination of solutions above (especially Fourth and Fifth)
--------