rsync

is somekind a tool to synchronize between 2 pc.

the rsh need to communicate at port 22, though it can be re-configured, and in daemon mode an additional port need to be opened, the default is port 873, this mode allows no authentication which make it easy for scripting synchronization.

example  :
(rsh) : rsync -v user@srchost:dir dest
(daemon) : rsync -v srchost::dir dest
(::) is not typo
example configuration daemon mode (/etc/rsyncd.conf) :

[oneslash]
comment = oneslash
path = /
exclude = /proc /sys /tmp
read only = no
write only = no
use chroot = yes
list = yes
uid = root
gid = root
hosts allow = 192.168.1.3
hosts deny = 0.0.0.0/0

Cloning PC : Sync a / (slash)

start with livecd/usb, make sure the ethernet is detected, setup so that it can connect with the thing you want to clone.
in order to complete this quite hefty job … there are several things todo to make the cloning process very smooth :

  1. exclude /proc /sys and any other recursive and unwanted link … and use only archive mode
  2. mount the device that want to be rsync with, and then rsync, a daemon mode is recommended
  3. example : rsync -avR 192.168.1.2::aslash /mnt/
  4. after the cloning complete, a few errors would likely to come up. if the system doesnt fo much changes in 1 hour rsync it again to get the latest version
  5. mount the /proc to /mnt/proc : mount -tproc /proc /mnt/proc
  6. copy all the /dev to /mnt/dev to make sure all the device in the current computer is detected (cp -a /dev /mnt/dev)
  7. edit mounted files : /mnt/etc/fstab /mnt/etc/mtab to the corresponding device and path (this has to be done properly … or else grub / lilo will complain later)
  8. change the each mac-address devices so that matches ethX name e.g. debian(/mnt/etc/udev) redhat(/mnt/etc/sysconfig/network-scripts/ifcfg-ethX) change the IP if necessary.
  9. edit grub’s devices.map to the corresponding device then chroot to mounted filesistem (/mnt/) and run update-grub then grub-install device

There … reboot and you got a sistem that very much alike …

Leave a Reply

Your email address will not be published. Required fields are marked *