network clone disk



Clone over SSH


Server A (Source) --> ServerB

# Run on Source
# ServerB is Destination

dd bs=16M if=/dev/sda | ssh -C root@serverB "dd bs=16M of=/dev/sda"

-C     # Requests compression(gzip) of all data
        # (including stdin, stdout, stderr, and data for forwarded X11, TCP and UNIX-domain connections)



SystemRescueCd Clone 機時注意事項


1. Stop NetworkManager

/etc/init.d/NetworkManager stop

2. Stop LV

# 看什麼 active


# 一次過 Disable ALL LV

# Controls the availability of the logical volumes in the  volume group  for input/output

vgchange -a n

Activation of a logical volume creates a symbolic link /dev/VolumeGroupName/LogicalVolumeName pointing to the device  node.

This link is removed on deactivation.


Clone over NC


# Diagram

Source: 100.1 --> Destination: 100.2

# Run this command in server B (Destination)

nc -l -p 19000 | dd bs=16M of=/dev/sda

# Run this command in server A (Source)

dd bs=16M if=/dev/sda | nc 19000



Compression with NC


local disk dd ~ 63 MByte/s

raw  ~ 35 MiB/s

gzip ~ 16 MiB/s

bzip ~ 1.3 MiB/s

pigz(2CPU) ~ 25/MiB/s

Example: bzip

S: dd bs=16M if=/dev/sda | bzip2 -c | nc 19000

D: nc -l -p 19000 | bzip2 -d | dd bs=16M of=/dev/sda