mkdrtape - Create Disaster Recovery Tape.
mkdirtape [ -n ] [ -t tapename ]
The function of mkdrtape is to create a standalone system for
recovering from loss of the system disk. Thus it must save all
information necessary to recreate disk partitions and save
system (Operating System) data. It should be able to
reinitialise a blank disk (the same geometry and size as the
failed disk) to the same state as when the recovery tape was
created.
The program creates a series of rebuild scripts and stores
them in /var/dr. Once all rebuild scripts have been created,
a tar file is saved to tape as the first tape file. Then each
partition listed in /etc/fstab is saved to tape using the
dump utility.
The disaster recovery tape should be made/updated whenever
changes are made to the system. The disaster recovery tape is
not intended to be a replacement for regular backups. A
regular backup schedule is still necessary to safeguard user
data. The disaster recovery tape is intended to recover the
system to a working state so that recovery of data from
backup media is possible.
A boot floppy disk containing a modified OpenBSD 2.9 install
image is used to initially boot the system, recover the rebuild
scripts from the tape and commence the rebuild. An image file
of the floppy disk is bundled with the mkdrtape program. See
the "Creating Boot Floppy" section for details of how to create
a boot floppy.
The components necessary to completely recover the system are:
1. The boot floppy.
2. A valid recovery tape created by mkdrtape.
3. A recent backup tape. (If recovery of user data is required.)
There are two floppy disk image files bundled with mkdrtape. One
called floppyB29.fs and one called floppyB29-ser_cons.fs. The
floppyB29.fs image will use the system keyboard and video display
for all input and output. The floppyB29-ser_cons.fs image will
use the first serial port for all input and output.
For the serial console image, output will be seen shortly (seconds)
after the system starts to boot from the floppy.
To create the boot floppy, copy the desired image file to a
machine with a floppy drive. If it is a unix machine, use
dd(1) to write the image to the floppy disk. Consult the
dd(1) man page for the exact syntax for your O.S. For OpenBSD
you would use this as root:
dd if=floppyB29.fs of=/dev/fd0c bs=32k
For DOS/Windows machines, there is a utility named rawrite.exe or
ntrw.exe in the 2.9/tools subdirectory of the OpenBSD 2.9 CD
disk 1. Use rawrite.exe for DOS machines and ntrw.exe for NT
machines.
Copy the image file and rawrite.exe or ntrw.exe to a temporary
directory. Then run rawrite or ntrw and follow the prompts to give
it the information for where to find the image file and what
floppy drive to use.
To create a disaster recovery tape, insert a tape into the tape
drive and run the mkdrtape program. If your tape device is
something other than /dev/nrst0, you will need to give the
-t tapedevice switch. (See EXAMPLES).
Note: you need to specify a non-rewinding tape device or your
data will not be backed up.
The mkdrtape can be run on a running system, the system does
not need to be booted to single user mode. Open log and user
files are not the concern of the mkdrtape utility. Mkdrtape
captures disk partitioning information using fdisk(8) and
disklabel(8) and then saves system data using the dump(8)
utility. This saves the state of the system including the
current patch level.
To rebuild the system from the disaster recovery tape, insert
the disaster recovery tape into the tape drive, insert the
modified boot floppy disk that came with mkdrtape into the
floppy drive and reboot the system.
Once the floppy has finished booting the system, a simple one
line menu lists the following options:
(I)nstall, (U)pgrade, (S)hell or (R)ecover?
Choose the Recover option by typing r<ENTER>. The recover
script will then prompt you for the tape device. You can hit
<ENTER> to accept the default device. If your tape device is
something other than /dev/rst0, type in the name of the tape
device and hit <ENTER>. The recover script then extracts the
rebuild scripts from the disaster recovery tape using the tar
utility from tape file 0 into a temporary directory. It will
then run the rebuild scripts to rebuild the system and extract
the data from the tape using the restore utility.
Note that when creating the recovery tape with mkdrtape, you
need to specify the non-rewinding tape device. However, when
you actually recover from the tape, you need to specify the
rewinding tape device.
You will need to ensure you have access from the machine where
you are trying to create a disaster recovery tape, to the machine
that has the tape drive. See rhosts(4) for details.
If you choose to use remote tape devices when performing the
rebuild, you will also need to manually configure networking
when the recover script prompts you. You will be given an
opportunity to escape to a shell to do this.
You will need to be able to use the ifconfig(8) and possibly
the route(8) commands and know the device name for your
network interface. e.g. xl0, to configure networking in order
to access the remote tape drive.
-n This switch was used in development to allow creation
of the rebuild scripts without saving any data to tape.
-t Tape device. The default value is /dev/nrst0. You must
use the non-rewinding device or your data will not be
backed up. If the device is of the form
host:/path/to/device then the data will be saved to
this device using rsh. If the device is of the form
user@host:/path/to/device, rsh -l user host will be used.
mkdrtape -t /dev/nrst0
0 The tape was successfully created
>0 An error occurred.
/dev/nrst0 The default tape device for creating tape
/dev/rst0 The default tape device for restoring data
/etc/fstab Contains static information about the
filesystems
/var/dr The directory where the rebuild scripts are
created.
fdisk(8), disklabel(8), installboot(8), dump(8), restore(8)
David Billett <David.Billett@clearcom.com.au>