(There are many forks, this seems to be the most complete and maintained)

Tuturial on moving kvm images with blocksync:

Blocksync can sync only from a device, not a file.
It's perfect to turn a virtual machine e.g. from lvm to a raw file image.

Installation on Ubuntu

Login as root


  • --blocksize  4194304, or 16777216
  • --createdest = create target file
    • should be safe to use in subsequent calls, as truncate() modifies the file only if it's given a different file size than the current one (it either truncates it to a lower size or pads it with zeros if larger).
  • --workers = number of workers to fork 4-8 -> parallel processing -> fast!
  • --splay=250 = add a sleep interval between forks
    • Use in combination with --workers
  • --script = path to the script on the remote side, otherwhise it is copied to /tmp
    • --script=/root/bin/
  • --cipher= you have to give a ssh cipher
    • aes256-ctr  -> widly supported
    • -> faster?
    • List available ciphers with "ssh -Q cipher"


  • ~/ --blocksize=4194304 /dev/xyz localhost /mnt/myserver.root.img
  • ~/ --extraparams="-p 2222" --cipher=aes256-ctr --blocksize=4194304 --workers=4 /dev/xyz /srv/libvirt_images/myserver.root.img

Workaround for img to img

  • kpartx -al /srv/libvirt_images/myserver.root.img
    • /dev/loop0
  • ~/ --extraparams="-p 2222" --cipher=aes256-ctr --blocksize=4194304 --workers=4 /dev/loop0 /srv/libvirt_images/myserver.root.img
  • kpartx -r /srv/libvirt_images/myserver.root.img