2015-01-22

How to clone a disk using dd over network

!Warning: This method is hardcore and may not be used on production machines! There is a cleaner procedure at the bottom.

Required tools : dd, nc (or ssh is the link is not trusted) and one of these following tools:

  • If you have a lot of bandwith, I recommand the use of lz4
  • If you have a lot of CPU and less bandwith, go with gzip
  • If you have a extremely tiny bandwith and huge amount of CPU, use lzma but I don't recommand it


First, login on the machine you want to clone.

dd bs=16M if=/dev/vda |lz4c -c |nc 172.30.12.6 12345


Create a machine in your new environment.
Create a disk about the same size of you source disk
Attach it to a third party machine in your new environement.
root@tranfert:~# nc -l 13245|lz4 -d|dd bs=16M of=/dev/vdc


Clean Procedure:
Take a snapshot of a volume, mount this snapshot to a linux machine




No comments:

Post a Comment

Popular posts