Linux:how to clone hardrive over network

Purpose :
I want to clone a hardrive “/dev/sda” over network.
Server A will get the clone data and Server B will will sent the clone data.

disk space of Server B is :

 fdisk -l
 
Disk /dev/sda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00083b1c
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2329    18705408   83  Linux
/dev/sda2            2329        2434      842753    5  Extended
/dev/sda5            2329        2434      842752   82  Linux swap / Solaris

step 1:
Receving Serer (Sever A) :

nc -l -p 1234 | dd of=/dev/sda

step 2:
Sending Serer (Sever B) :

dd if=/dev/sda | nc 192.168.1.220 1234

it will start to clone hardirve.

it can take up to 3 to 4 hours depends on hardrive size.

Leave a Reply

*