Clone Debian over SSH using Rsync

  • Posted on January 5, 2014 at 03:11

A simple walk-through

On the target machine:

  • Net-install the same Debian-distro with Graphical User-Environment and SSH-Server
  • Boot that the new installed Debian OS
  • Install some tools:
    # apt-get install rsync parted htop xfsprogs
  • If you feel like it: Make a separate /home – partition, mount it, and add it to you /etc/fstab
  • Secure your fstab:
    # cp /etc/fstab /boot/_etc_fstab
  • Start the SSH-Server:
    # /etc/init.d/ssh start
  • Get the target IP:
    # ifconfig -a eth0

 

On the original machine:

  • Go cloning:
    # rsync -aAXv --delete --progress --exclude={/boot/*,/dev/*,/mnt/*,/proc/*,/sys/*,/tmp/*,/run/*,/media/*,/lost+found} --rsh='ssh -p22' /* root@ip-target-machine:/

 

Go back to your target machine and copy back your fstab and reboot:

  • Restore your fstab:
    # cp -f /boot/_etc_fstab /etc/fstab
  • Reboot:
    # shutdown -r now

Have fun with your fresh Debian install!
Well fresh… “Your already configured Debian install”.

Don’t forget to re-install your VMware-Tools! Your GRUB may needs updating for some extra kernel-parameters.

 

Leave a Reply