
 Creating a tbackup rescue disk.

*** INTRODUCTION

Some harddisk disasters leave you without a bootable Linux system on
the harddisk, or with a system that can no longer run tbackup.

In order to restore your backups in this case, you first have to make
a new (preferably small) Linux system on your harddisk and reinstall
tbackup.

A tbackup rescue disk allows easy installation of tbackup on a minimal
system.  You can make a tbackup rescue disk after you have installed
and configured tbackup.  Apart from tbackup itself, it contains the
afio program, mtools, and several other programs like gawk and grep
that are needed by tbackup to run.

To make a minimal system on your harddisk, you need a `minimal Linux
installation kit', usually a set of floppies.

Of course, in stead of making a minimal system, you can also just
reinstall a complete Linux distribution and then do the normal tbackup
installation (which requires gcc, among other things).  If you only
use tbackup to back up user files, you need to do this anyway.

If you back up your whole system with tbackup, using a tbackup rescue
disk and a minimal Linux installation kit is much less work:

- you do not have to keep a whole distribution on on floppies
  (assuming you don't have a cdrom drive of course)
- installing a minimal Linux system takes less time
- a minimal system leaves more room for restoring files
- cleaning up a minimal system after the restore takes less time.


*** THE MINIMAL LINUX INSTALLATION KIT

Even if you don't use tbackup, you should have a small bootable Linux
system on floppies.  This system can be used for repairing damages if
your Linux system on harddisk becomes unbootable (e.g. after
accidentally deleting /lib/libc.so.4).

A minimal Linux installation kit should at least enable you to

 - boot a floppy based Linux system
 - repartition your harddisk
 - check existing partitions for damage
 - make a new Linux filesystem on a partition
 - put a small Linux system on this partition
 - create a boot image (kernel) for the small Linux system system on 
   a floppy or on the hard drive

The same operations are needed when first installing Linux on a PC.
Thus, all Linux distributions (Slackware, SLS, Debian, ...) have a
Linux installation kit contained in them, usually the first few disks
of the distribution.  But this installation kit may not necessarily be
very minimal.  For example, with the first 5 floppies of Slackware
1.2.0 (bootfloppy, rootfloppy, and a1, a2, a3) you can use the
standard `setup' program to create a Linux system on your harddrive
that is about 5 Mb. large.

With only the boot and root floppies however, you can make a minimal
system that is only 2 Mb. large.  You can't use the standard setup
program for this, but it is not very difficult.  More about this
later.

Apart from taking the first few disks of a distribution you can make a
specialized minimal Linux installation kit.  Such specialized floppies
are usually called `rescue disks'.  There are a few descriptions
around on how to make them, but it is not an entirely trivial process.

As far as the tbackup rescue disk is concerned, the only requirement
is that the minimal Linux system

 - is on a harddisk partition
 - has 3 Mb. or more harddisk space free somewhere
 - has at least 8 Mb. virtual memory (RAM+swapspace)
 - has a working tar and gzip

After you have restored your backed up system files, you can remove
the minimal system.  Trestore allows you to keep the minimal system
and the restored system files separate.  Thus, you can easily use SLS
disks as a minimal system kit, even if your backed up system is based
on Slackware.


*** PREPARING A MINIMAL LINUX INSTALLATION KIT

Depending on what you intend to use as a minimal Linux installation
kit, here are some remarks on preparing one:

* 1) Using the bootdisk/rootdisk and the `basic' disk set of a standard
     distribution.

  Take the first few disks of the distribution. Read the installation
  documents of the distribution to see what disks you need for an
  absolutely minimal system.
  
  At the time of writing this manual (may 1994), the situation is:
  
  Slackware: you need a bootdisk, a rootdisk, and the `a' disk set a1,
  a2, and a3.
  
  SLS: you need the `a' disk set, which includes a boot/root disk.
  
  Debian: you need the bootdisk and the two basedisks.
  
  Other distributions: unknown.
  
  Note that the kit should include gzip and tar. All three disk sets
  above do this.
  
  Depending on how easy it is to get new ones, you may want to create
  two copies of each required floppy.
  
  
* 2) Making `rescue' disks
  
  No hints on this one, except that you _do_ want to create two copies,
  especially if the floppies can't be used write protected.
  
  
* 3) Using the bootdisk/rootdisk of a distribution.

  This has the disadvantage that  you can't use a standard setup
  program.  If you know how to do things without the standard setup,
  this option takes less time than 1).

  At the time of writing this manual (may 1994), the situation is:
  
  Slackware: you can use the bootdisk and rootdisk
  
  SLS: you can use the boot/rootdisk
  
  Debian: you can't do it with the debian bootdisk, as this disk has
          cpio in stead of tar.
  
  Other distributions: unknown.
  
  The trick is that you just copy the files on the rootdisk to a
  harddisk partition as a way of making a minimal Linux system. Here
  is how to do it:
  
  a) Follow the first part of the installation instructions of the
     distribution, up to the point of logging into the floppy system.
  
  b) Log in as root.
  
  c) Prepare a partition for the minimal system.  If you have
     8 meg RAM, an attractive option is to use a swap partition larger
     than about 6 meg for this.
    
  d) Mount the partition on /mnt. 
  
  e) Copy the floppy contents to the partition with
  
        cp -adxP / /mnt
  
  f) Create the mount points on the partition that weren't copied
  
     mkdir /mnt/proc /mnt/mnt
  
  g) Make the partition bootable in some way, see the distribution
     documentation.

  This leaves you with a minimal bootable Linux system on your harddisk.
  
  Depending on how easy it is to get new ones, you may want to create
  two copies of each required floppy.


*** MAKING THE TBACKUP RESCUE DISK CONTENTS

Before you can do this, you need to install and configure tbackup.

Making the contents is done by a shell script. cd to the directory
/usr/lib/tbackup/rescue and type 

  ./makedisk 

This prepares the rescue disk contents in a directory called
/tmp/disk.  The script gives an error message if it can't find an
auxiliary program needed by tbackup:

  | Looking for auxiliary programs...
  |
  | ERROR: auxiliary program hostname not found.
  | Please correct the error(s) and run again.  See the RESCUE file.
  | I will go on creating the disk contents, but some things will be missing.

In this case you don't have the program hostname, which is needed by
tbackup, in your path.  You need to correct this and run ./makedisk
again.

[If you don't have the setfdprm program however, you only need to
correct the error if you made backups with extended floppy densities.]

The ./makedisk script will fail if you have a very old Linux
installation without shared libraries and /lib/ld.so.  The only way to
fix this is to upgrade your system.


*** SHARED LIBRARIES NEEDED

Almost all Linux binaries need shared libraries to work.  Tbackup, and
the programs needed by tbackup, only need the shared C and Math
libraries /lib/libc.so.? and /lib/libm.so.?, where ? is stands for a
version number.

These libraries are packed on the tbackup rescue disk by the
`makedisk' script. This script assumes that all binaries packed on the
rescue disk work with the latest shared library versions in your /lib
directory.  This assumption may not be true if the programs on your
system come from various sources or are very old.

To check the assumption about the libraries needed, you should run the
`./checklibs' script.  If is goes well, the script should produce
output like this:

  | # ./checklibs
  |   ^^^^^^^^^^^
  | The makedisk script packs the latest shared library versions:
  | /lib/libc.so.4.5.24  /lib/libm.so.4.5.24
  | 
  | Finding the shared library versions needed by tbackup and its
  | auxiliary programs...
  | 
  | Libraries needed:
  |         /lib/libc.so.4 (Jump table 4.1)
  |         libc.so.4 (DLL Jump 4.4pl1)
  |         libc.so.4 (DLL Jump 4.4pl4) => /lib/libc.so.4.5.24
  |         libc.so.4 (DLL Jump 4.5pl19) => /lib/libc.so.4.5.24
  |         libm.so.4 (DLL Jump 4.4pl4) => /lib/libm.so.4.5.24
  | 
  | All OK, the programs on the tbackup rescue disk work with the
  | Latest shared libraries.
  | #
 
You can ignore warnings like
  | ldd: /usr/bin/apropos is not {Z,Q,O}MAGIC
  | ldd: can't read header from /usr/bin/arch
from checklibs. 

If you get the `All OK' message, you can skip the rest of this section.


If checklibs prints an error message, e.g.

  | ERROR: older (?) shared library versions are needed by the programs on the
  | tbackup rescue disk.
 [...]
  | This situation should be corrected if a good tbackup rescue disk
  | is to be made.  See the CREATE file.

some of the programs packed on the rescue disk use shared library
versions that were not packed on the rescue disk.  These programs
should be upgraded to versions that use the latest shared libraries,
else the rescue disk won't work.  After the upgrade you should run
`makedisk' again to update the rescue disk contents.

You can check which programs use older libraries by reading the output
of `./checklibs -v', do a

  | # checklibs -v |more
      ^^^^^^^^^^^^^^^^^^
the offending programs will have different library names printed below
them.

If checklibs `hangs' at a certain point, you probably have an old
binary among the auxiliary programs that doesn't use the ld.so linker.
You can use `checklibs -v' to find out which binary causes the hang.
Getting a newer version of the offending binary is the only easy way
of ensuring that a good tbackup rescue disk is made.


*** COPYING THE RESCUE DISK CONTENTS TO ONE OR MORE FLOPPIES

The contents in /tmp/disk are approximately 800 Kb. large.  You can
either copy them to an MSDOS format disk or to a disk with a Linux
filesystem on it.  The only requirement is that the disk can be read
(mounted) by a minimal Linux system.  Using MSDOS format disks is
attractive because this allows you to read or print the documentation
files on the rescue disk before bringing up a Linux system.

If you don't have high density drives, you will need to divide the
contents between two disks.  When using the rescue disks, you then
first need to copy the contents of both disks to a single directory on
your hard disk.

For extra safety, you will probably want to make two copies of the
tbackup rescue disk(s).

After you have made the rescue disk(s), you can remove the /tmp/disk
directory.


*** CONTENTS OF THE TBACKUP RESCUE DISK

In case you wonder, here is what is on a tbackup rescue disk:

- The documentation files in /usr/lib/tbackup/rescue

- Some shell scripts beginning with `inst', a script called
  `makelinks' and a file called `auxlist' for installing the rescue
  disk contents

- Several archives:
   auxbin.tgz  contains auxiliary programs needed by tbackup
   bash.gz     contains /bin/bash
   ld_so.gz    contains /lib/ld.so
   libc.tgz    contains the libc.so library
   libm.tgz    contains the libm.so library
   tbresc.tgz  contains tbackup and its configuration files

- some other useful stuff:
   fdisk.list  partition table(s) of your harddisk(s), this information
               is useful if a partition table is damaged somehow.
   fstab.list  contents of /etc/fstab, sometimes useful in the same situation.
   vi_more.tgz the vi and more programs.


*** TRYING OUT YOUR RESCUE SYSTEM

If you want maximal safety, you will have to try out the your rescue
system.  You will need a small (6-20mb) free harddisk partition to do
this.  Depending on the size of the minimal Linux installation kit,
you may be able to temporarily use a swap partition.

The instructions on bringing up a rescue system are in the USE file.

To test if the rescue system is successfully installed, you can try
restoring a (previously made) small backup with trestore.  The other
programs in the tbackup package (tbackup, tlist, tguess, tdir) should
also work, but there is no real need to test them all.


*** KEEPING YOUR RESCUE FLOPPIES UP TO DATE

Once you have good rescue floppies, there is hardly ever a need to
update them.  Below are a few situations that do make an update
necessary.

1) You need do create a new minimal Linux installation kit if

- you have new hardware that isn't supported by the old kit

- you back up on tape, and a drastically improved version of the tape
  driver is released

- your Linux system on harddisk uses some new file system types
  (compressed fs, ..) that cannot be accessed by the software in the
  kit, making repairs impossible
  
2) You need to create new tbackup rescue disk(s) if

- a new version of tbackup introduces an archive format that cannot be
  read by the old version on the rescue disk

- a new version of tbackup has some critical bug fixes
  
  (If one of the above happens, you will be warned in the
  documentation files of the new tbackup version.)

----------------------------------------------------------------------
