next up previous
Next: Partition Backups Up: CloneSys Documentation Previous: Initial Multi-Boot Installation

Installation and Configuration of CloneSys

Directory Structure

The CloneSys tools are installed on an image server which stores all the partition images. This server has to export these image directories to all the cluster machines via nfs (or samba). We equipped a designated machine (our cluster server) with an additional large disk, which can be mounted on demand.

On our cluster we use the following directory structure:

    /images/cloneimages/   <partition- and disk-images>
                           ..
            scripts/       <tools and commands>
                           .cloneconfig
                           ..
            logs/          <logfiles and configuration>
                           clone.log
                           imagedesc.txt
                           clustermap.txt
                           ..
            logs/lastlogs/ <last log files of clone>
                           ..
            config/        <cluster configuration machine files>
                           ..

Clone Images

The cloneimages subdirectory contains the gzipped partition images. The file names are constructed as follows: device_imagename.gz, e.g. sda1_SysCom.gz.

Scripts

The scripts subdirectory contains all the tools as well as the tool configuration file .cloneconfig which has to be placed in the same directory as the scripts. The .cloneconfig file contains path declarations as well as pointers to the log files. Our configuration looks like this:

# Configuration for Clone Sys Scripts 
# PATAGONIA CLUSTER ETHZ

# Installation directory of CloneSys
CLONESYS=/images

# Default path where to find images
ipath=$CLONESYS/cloneimages

# Path for config files
configpath=$CLONESYS/config

# Path where to find scripts
scriptpath=$CLONESYS/scripts

# Path for log files
logpath=$CLONESYS/logs

# Log file for all clonesys commands
clonelog=$logpath/clone.log

# Path for lastlog files
lastlog=$logpath/lastlogs

# Image Database File
imagedesc=imagedesc.txt

# lastlog suffixes
suffixrun=running
suffixfinish=finished
clonesuffix=clone_$suffixrun
clonesuffixfinished=clone_$suffixfinish
clonesuffixremote=clone_remote
backupsuffix=backup_$suffixrun
backupsuffixfinished=backup_$suffixfinish
locksuffix=lock

# Alias for machine name
prefix=rifpc

# Initial Image (Zeroed Partitions and SysCom, CloneSys in one image)
initimage=default      # image specified in config file

# Initial Configuration (must be the same as with initimage)
initconfig=initconfig

# Image Server
imageserver=imageserver.ethz.ch

Hostname Aliases

For easier access to the machines we have defined DNS aliases for all of them. The aliases have all the same prefix, i.e. rifpc, followed by a host_id. With the mapname command these aliases or just the host_ids alone can easily be mapped to the full hostname.

Log Files

The logs subdirectory stores the clone.log file which contains log entries of all the clones, backups, locks and unlocks performed with CloneSys commands.

imagedesc.txt contains the descriptions of the images stored in cloneimages. An entry looks like this:

Image  : /images/new_images/sda5_WinNTEduD_SP4.gz
Origin : client1
User   : kurmann
Date   : Tue May 25 12:51:24 CEST 1999
Comment: WindowsNT Educ D with SP4, Xwindows, Netscape 4.6

clustermap.txt contains a map of the cluster as well as the ip names of the machine. This file is shown by the command clustermap just for information.

The lastlogs subdirectory contains the last logfiles for all the machines. There are different suffixes used for clone-, backup-, lock- and error-logs. These log files can be viewed or deleted with the lastlogs command.

The clone- and backup-logs additionally have a suffix _running or _finished indicating if a process is running or finished. This can be viewed with the state command.

Configuration

The configuration of CloneSys is done in a separate file for all the cluster machines. The config files are located in the config subdirectory and have the following structure:

partition:path:image:cloned:user:lockedby:reason:

For each installed partition there is a partition (or device) identifier, the path, where the image is stored, the image name and the date when the partition was last cloned by the specified user. Additionally there can be entries for locked partitions. The user who has requested the lock and the reason are indicated in the appropriate fields.

We have partitioned our cluster machines as listed in the following table.

Device Name Size Partition
sda1 System Commander 16 MB Primary, Activ
sda2 Linux CloneSys 200 MB Primary
sda4 Extended
sda5 Windows NT Education 1.9 GB Logical in sda4
sda6 ETH Oberon Education 100 MB Logical in sda4
sda7 ETH Oberon Research 100 MB Logical in sda4
sda8 Linux Swap 100 MB Logical in sda4
sda9 Linux 900 MB Logical in sda4
sda10 Windows NT Research 1.9 GB Logical in sda4
The appropriate configuration file is given below:

partition:path:image:cloned:user:locked:reason:
sda:/images/cloneimages:sda_InitClone.gz::kurmann:kurmann:admin:
sda1:/images/cloneimages:sda1_SysCom.gz:05/21/99:kurmann:kurmann:admin:
sda2:/images/cloneimages:sda2_CloneSys.gz:05/25/99:rauch:rauch:admin:
sda5:/images/cloneimages:sda5_WinNTEduD_SP4.gz:06/01/99:bmc:::
sda6:/images/cloneimages:sda6_OberonEdu_2.3.6.gz:06/01/99:muller:::
sda7:/images/cloneimages:sda7_OberonRes_2.3.6.gz:06/01/99:muller:::
sda8:/images/cloneimages:sda8_LinuxSwap.gz:06/01/99:rauch:::
sda9:/images/cloneimages:sda9_Linux_6.0_UNI.gz:06/01/99:rauch:::
sda10:/images/cloneimages:sda10_WinNTRes.gz:06/01/99:kurmann:::

Note the image for the device sda. This is the initial clone image which initialized the whole disk and the CloneSys Linux system as described in the next Chapter. This initial clone generates the configuration file for a new machine automatically.

Generation of an Initial Clone Image

As described in the previous Chapter, the setup of a master machine is the prerequisite for the cloning process.

In addition to all the partition backups, we use an InitClone image which is a backup of the whole disk. This allows us to just clone this image onto an emtpy harddisk to initialize the partitioning as well as the boot commander and the configurations in one step, independent of any operating system specific specialities.

To keep this image short we wipe all the partitions with zeros (e.g. with dd if=/dev/zero of=/dev/sdaX bs=4096) except the SysCom and the CloneSys partitions which contain the boot commander as well as the small Linux system needed for cloning the rest of the system. To generate such an image one can use the backup tool or just type something along the line (with paths adjusted):

 
dd if=/dev/sda bs=1024 |gzip -c |dd of=sda_InitClone.gz bs=1024

In addition to the generation of this image a configuration file called initclone must be written corresponding to the configuration of the machine and the initclone-image. This is stored in the config directory. In our cluster this initial configuration looks like this:

partition:path:image:cloned:user:locked:reason:
sda:/images/cloneimages:sda_InitClone.gz:::::
sda1:/images/cloneimages:sda1_SysCom.gz::kurmann:kurmann:admin:
sda2:/images/cloneimages:sda2_CloneSys.gz::kurmann:kurmann:admin:
sda5:/images/cloneimages:sda5_WinNTEduD_SP4.gz:::::
sda6:/images/cloneimages:sda6_OberonEdu_2.3.6.gz:::::
sda7:/images/cloneimages:sda7_OberonRes_2.3.6.gz:::::
sda8:/images/cloneimages:sda8_LinuxSwap.gz:::::
sda9:/images/cloneimages:sda9_Linux_6.0_UNI.gz:::::
sda10:/images/cloneimages:sda10_WinNTRes.gz:::::

All the partitions are wiped with zeros except the sda1 and sda2 which contain the boot commander and the Service-Linux system.

This initial configuration is automatically installed when an initial install is done with initinstall. After that it is possible to just use the restore script to install all the remaining partitions.

Initial Clone

As mentioned in the last Chapter we use a minimalistic boot-floppy / boot-Zip-disk combination based on the Linux distribution muLinux to boot a new or broken machine. With such a boot disk the empty machine can be booted and brought to the network.

The next steps are just to mount the /images directory from the imageserver over the network and to start the initinstall script which installes the initial image and configuration file. With this the machine can be booted in the Service-Linux system an the remaining operating systems can be installed with the restore or rclone scripts.

Example of an initinstall

Boot the machine with the muLinux boot floppy or zipdisk and login as root. Then mount the /images directory from the server

 mount /images
or depending on your /etc/fstab
 mount -t nfs imageserver:/images /images
(where imageserver is the machine which stores the partition images)

Start the installation script:

/images/scripts/initinstall hostname yourname

This will install the sda_InitClone.gz image to the device sda on the local machine an generate an initial configuration file for the machine in the config-directory (by copying the initconfig file).

After that the machine has to be rebooted into the now newly installed CloneSys (Linux) where the rest of the partitions can be installed with rclone or restore.

Caution! Don't boot uninstalled systems as they could be automatically removed from the boot-menu.

Restoring the partitions means that the same images that are specified in the initconfig shall be initialized. To restore one or more partitions on a cluster the restore script can be used as follows:

 restore yourname -d sda5 sda6 sda7 sda8 sda9 sda10 -h hostname

This restores the images for all the partitions sda5 to sda10 on the machine with the given hostname. This command can be executed local or on a server.

It calls the rclone command for all the specified devices and machines with the default image which is the image specified in the config files.

If different images shall be installed the rclone script can be used as follows:

 rclone sda5 WinNTEducNew yourname hostname

which would install the image WinNTEducNew on sda5.


next up previous
Next: Partition Backups Up: CloneSys Documentation Previous: Initial Multi-Boot Installation

Christian Kurmann
Wed Dec 22 11:02:02 CET 1999