2004-08-04 14:46

by Vasil Kolev

Because there was a question how exactly can you clone machines with tar and netcat, here’s a short explanation.

We have machine R – already installed, and machine I, which we want to install.

1) On machine I we boot a liveCD distribution, like knoppix, partition the drive, make the file systems and the swap.

2) mount the main file system in /mnt/1 (for example), and chdir there.

3) We start (quickly) one after the other the following commands:
On R: tar cpsf – bin boot cdrom dev etc floppy home initrd lib mnt root sbin tmp usr var |nc -l -p 9988 -w 10
On I: nc -w 10 ip.addr.of.R 9988 |tar cfps –
This does the copying between the machines, and the willing can put a ‘v’ option on either tars, and to watch what’s being copied.

4) After that’s finished, you can go and fix the configuration of the copies distribution – /etc/hostname, /etc/hosts, /etc/network/interfaces , etc…, create a /proc, and then we do a choort /mnt/1 /sbin/lilo (if you’
re using LILO, I can’t remember what was the way with GRUB), and we’re ready.

Leave a Reply