The computer you want to replicate is called your model. All along this documentation we refer to a computer called miniroot-server. For basic use of replicator, miniroot-server IS THE SAME than model. This computer is the one where you want to install replicator.
It's a standard Debian package :-). Just use dpkg or apt.
Warning: The kernel running on the computer where you will create the bootdisk (see 4.5.1) must support loop device. Standard kernels shipped with Debian are ok.
If you are upgrading from version 1.X, I strongly suggest that you create a new miniroot using repli-miniroot. You should also check carefully the new /usr/share/doc/replicator/replicator.conf.example.
Edit the file /etc/replicator/replicator.conf (it is heavily commented). Change the value of the perl variables to fit your needs.
The following sections are presented here in the order they are used during the replication.
#List of networks/targets the bootdisk will handle. #you don't need to fill this variable if you only #plan to install dhcp clients. @networks = # network domain netmask gateway broadcast targets list (["192.168.32.0","prof.my.domain","255.255.255.0","192.168.32.1","192.168.32.255","teachers"], ["192.168.33.0","my.domain", "255.255.255.0","192.168.33.1","192.168.33.255","sysadm_net"], ["192.168.34.0","maths.my.domain","255.255.255.0","192.168.34.1","192.168.34.255","maths"], ); #for each network create the corresponding targets list @teachers=qw(teach1 teatch2); @sysadm_net=qw(adm1 adm2 adm3); @maths=qw(maths1 maths2 maths3 maths4);
This is how replicator proceeds:
To define an empty update rule use the syntax: @usr_exclude=qw("");
Compile a kernel with all the necessary driver for the computer target. Do not use modules for the drivers required at boot time (typically network and SCSI).
Add the following option during configuration of the kernel:
You must create such a kernel because the standard Debian kernels do not have nfsroot nor dhcp support enabled. This kernel will only be used for the installation floppy and will not be installed on target.
Compile this kernel with classical make dep ; make bzImage (don't use make-kpkg). This kernel will be use to boot the computer target. Put this new kernel in a safe place.
This will create a special filesystem (e.g. /export/install/miniroot) whith a basical Debian/GNU Linux on it.
VERY IMPORTANT: Each time you modify the configuration in /etc/replicator/ you must run the command:
Don't forget to export miniroot-dir for target with the no_root_squash option. To do that, edit /etc/export and add a line like:
Then tell the nfs-server to reload it's configuration:
Warning: Every line of /etc/export file must end with a newline character otherwise you will get silly error messages at boot time.
# #this is rsyncd.conf for replicator # [replicator] path=/ use chroot=no read only=yes uid=0 #max connections = 20 # #in case you don't use tcpwrapper (bad:) hosts allow=192.168.0.0/255.255.0.0 hosts deny=*
You are responsible for launching rsyncd on the model with this config files. That means either moving this file to /etc/rscynd.conf or editing your existing /etc/rscynd.conf to add the rsync module [replicator] as defined into /etc/replicator/rsyncd.conf.
You can either :
Don't forget to change the hosts allow
and hosts deny
settings.
You can create a shell script /etc/replicator/repli-postint. It will be executed at the very end of the copying process. It is your postint script. Again run repli-miniroot -update-config to copy this file to the miniroot.
Note: This script is run chrooted in the root filesystem of target (exactly as it would run after rebooting).
Here are some suggestions of what can you put in this script:
You can put a floppy right now in your floppy drive. If you interrupt repli-bootdisk with ctrl-C you can copy by hand the file /tmp/name-of-the-target.img on a floppy with the command cp.
To summarize:
The following examples should help you understand how replicator deals with its configurations files.
Starting with version 2.0.1 of replicator, you only need to fill the variable @networks and the corresponding lists of targets in replicator.conf. See 4.3.3.
For example, students'computers, have a 1GB harddisk with /home nfs-mounted and boot vith dhcp, whereas teacher has hardcoded network configuration, one 4GB disk for the OS and a second ide disk with local /home in /dev/hdb1.
In such a case we use /etc/replicator/replicator.conf to put defaults for the identical computers and we make a file /etc/replicator/replicator.conf_teacher for the unique computer teacher.
In /etc/replicator/replicator.conf :
@autopart_specs = #mount point min_size max_size ([ "/" , "100Mo", "1000Mo"], [ "swap", "64Mo", "128Mo"], ); $fstab_supp = "/dev/fd0 /floppy auto defaults,user,noauto 0 0 homeserver:/exports/home /home nfs rw,defaults,rsize=8192,wsize=8192 0 0 /dev/cdrom /cdrom auto ro,defaults,user,noauto 0 0\n";
In file /etc/replicator/replicator.conf_teacher:
@targets=qw(teacher); $domainname = 'classroom.here'; $gateway = '192.168.32.23'; $netmask='255.255.255.0'; $network='192.168.32.0'; $broadcast='192.168.32.255'; #mount point min_size max_size ([ "/" , "100Mo", "400Mo"], [ "swap", "64Mo", "128Mo"], [ "/usr" , "800Mo", "3000Mo" ], [ "/var" , "200Mo", "1000Mo" ], ); $fstab_supp = "/dev/fd0 /floppy auto defaults,user,noauto 0 0 /dev/hdb1 /home auto defaults 0 0 /dev/cdrom /cdrom auto ro,defaults,user,noauto 0 0\n";
Now create the bootisk with :
repli-bootdisk -config /etc/replicator/replicator.conf_teacher
To install a student computer, boot it with the bootdusk and chosse `` Boot with DHCP and Install a DHCP target'' in grub's menu. To install teacher, use the same bootdisk and choose ``Boot Teacher ...'' in grub's menu.