CLDD - A checkpointed logical disc driver

Introduction

CLDD is designed to solve one of the common practical problems with
making backups on an active live system: 

If you choose to backup the running system there is a good chance that the
backups will not be consistant because the data is continually changing.

If you stop the system and make the backups the outage is unacceptable to
the user community.

With CLDD you stop the system for a very short time - typically the outage
is the time it takes to stop the system and restart it plus a few seconds
for CLDD. You can then backup from a "slave" device which represents the
discs as they were at the time the system was brought down. At the same
time, from the users point of view the system is available.

How it works

Instead of accessing disc partitions directly you access them through a
logical device e.g. /dev/cldm0 - the "m" means master and the zero is
the device number.

An example:

You associate the logical device with a real disc partition with a
simple command:

clddsetup -m /dev/cldm0 /dev/hda2

After this you would create a filesystem in the usual way:

mkfs /dev/cldm0

Since you get nothing free in this World you will notice that only half
the capicity of /dev/hda2 is available!

You can check the status of the logical device:

clddsetup /dev/cldm0

You then use /dev/cldm0 as a normal disc:

mount /dev/cldm0 /home

At some time you want to backup /home. Stop all the systems which use it 
and then:

umount /home

Enable the "slave" of this logical disc:

clddsetup -e /dev/clds0

Notice that CLDD devices come in pairs - master and slave.

You can now mount /home again and the users can continue working.

mount /dev/cldm0 /home

But you can now also mount the slave device:

mount -r /dev/cldms0 /home-bu

The directory /home-bu now contains a snapshot of /home as it was at
the time it was last umounted. You can backup /home-bu in any way you
wish.

When the backup is finished you umount and disable the slave:

umount /dev/clds0
clddsetup -d /dev/clds0

CLDD will then synchronise the master device. This can take a little 
while if there has been a lot of change since the slave was enabled.

During all this time except for the short time when /home was umounted,
the users can continue to work. In particular they can continue to work
while the backup is being made. The backup is done on a snapshot of the
umounted /home.

Install

There is a kernel patch to apply to 2.2.9 - assuming /usr/src/linux:

cd /usr/src
patch -p0 < patch

make menuconfig - select CLDD on the block devices menu

make bzImage and run lilo etc as normal

make clddsetup in the cldd source directory

install it e.g. in /sbin

Finally

That's all there is to it.
It is experimental code at the moment - it could destory all your data.

Good luck.

Feedback please to Allan Latham <alatham@flexsys-group.com>

AJL - August 1999
