How to clone a running Linux system over network using netcat

This is a short but potentially extremely handy guide to ghosting one Linux box to another (or simply making a full backup of a desktop/server).

On the target machine:
[codesyntax lang="bash"]

nc -p 2222 -l | bzip2 -d | dd of=/dev/hdb

[/codesyntax]

On the source machine:
[codesyntax lang="bash"]

bzip2 -c /dev/hda | nc 10.111.1.206 2222

[/codesyntax]

Note:

  • please be VERY careful about IPs, devices and ports.
  • after completion of dd command you have to run fsck on target partitions

Scrie si tu o vorbulita


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.