home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BURKS 2
/
BURKS_AUG97.ISO
/
BURKS
/
LINUX
/
HOWTO
/
mini
/
backdos.txt
< prev
next >
Wrap
Text File
|
1997-07-07
|
16KB
|
362 lines
Backup-With-MSDOS mini-HOWTO
Earlier I posed the question on the Net, how does one back up a Linux
machine to a Colorado Jumbo 250 tape drive on an MS-DOS machine. From the
email I received, it seems that this is a frequently pondered problem.
Now that I've figured it out, I'm posting the method. If anybody wants to
massage this into a HOWTO document, let me know. I should thank Jim Nance
(jlnance@isscad.com) for pointing out that an MS-DOS machine need not
always be an MS-DOS machine. This technique should also work for any
other tape drive supported by the ftape module.
The criteria I set were that the resulting setup should be as secure
as possible and should be fairly simple, and take up little or no space
on the MS-DOS machine's hard drive. It should also be capable of
recovering from the worst system corruptions, up to and including the
theft of the hard disk, requiring a restore to a bare Linux file system.
The technique described here uses no hard drive space on the MS-DOS
machine, though it requires that that machine be assigned an IP#. You
will need three formatted, blank 1.44MB diskettes.
Throughout this description I will refer to two machines as "msdos"
and "linux". "msdos" is the name of the machine which has the tape drive
and is usually running MS-DOS. "linux" is the Linux machine whose disk
you are trying to back up or restore to the tape drive. For simplicity I
will refer to the first machine as "msdos" even when it is booted into
and running Linux. Further, all path names in this document should be
considered to be relative to the Linux machine with the Search-And-Rescue
(SAR) disks mounted somewhere on the system. That means that the file
/etc/passwd is the password file for your Linux machine's hard drive,
while, for instance, /tape144/etc/passwd is the corresponding file on the
floppy disk.
I am using Karel Kubat's backup scripts, version 1.03, available at
ftp://sunsite.enc.edu:/pub/Linux/system/Backup/backup-1.03.tar.gz.
Throughout this document I will refer to these simply as "the backup
scripts". You do not have to use these scripts for your own backups to
tape. I like these scripts as they use afio to form an uncompressed
archive of compressed files, rather than a compressed archive of
uncompressed files. The former is much safer if there is a media read
error during the restore. I understand that Karel is no longer supporting
backup, and now has produced 'tob', or tape oriented backup. While I
haven't tried the new package myself, it cannot make a significant
difference to the procedure outlined here.
First of all, obtain the ftape module. It is available at:
ftp://sunsite.unc.edu/pub/Linux/kernel/tapes/ftape-2.05.tar.gz
Next, get a Slackware boot disk (I got the net disk, but it doesn't make
much difference) and the tape144 root disk, and put the images onto 3"1/2
floppies.
The ftape module will only work if it is installed in the kernel which
was running when you compiled it. I could not get it to work with the
ftape.o module on the tape144 root disk, I think because that module has
been stripped of symbols and won't install. So, you now have to make a
new kernel with network and ftape support (if applicable, recent versions
of ftape do not need kernel support, and recent kernels do not offer the
option), and then a new ftape.o. Read the directions which ship with the
ftape archive for directions at this stage. Remember that the kernel you
compile must support the Ethernet cards on both the Linux machine and the
MS-DOS machine.
Copy the newly created kernel image over top of the one on the Net
boot disk. Use /bin/cp, do not create a boot disk with the "dd" command
as you would to create a bootable kernel image. Write protect the boot
disk, and label it: SAR#1.
Now, mount the tape144 root disk. I'll assume that the mount point is
/tape144, to avoid confusion in file names. We need to free some space
on it, so delete the following files:
/tape144/bin/dialog
/tape144/bin/elvis
/tape144/bin/vi
/tape144/boot/ftape.o
Now, create a new file:
/tape144/etc/exports
which contains the following line:
/mnt msdos(ro)
Where "msdos" should be replaced with the name or IP# of the MS-DOS
machine which has the tape drive installed.
Next, so that you don't have to rely on a name server, add lines to
the file /tape144/etc/hosts with the names and IP numbers of the Linux
and MS-DOS machines. For instance, mine contains the following two lines:
128.100.75.114 caliban.physics.utoronto.ca caliban caliban.physics
128.100.75.111 ariel.physics.utoronto.ca ariel ariel.physics
Now, there's some sort of problem with the inetd configuration. We
have to put the full path name of the rsh daemon in it. Change line 19
of /tape144/etc/inetd.conf to read:
shell stream tcp nowait root /usr/etc/tcpd /usr/etc/in.rshd
Add local net routing information to /tape144/etc/rc.d/rc.inet1 to
enable the MS-DOS machine to use the network. The format of this depends
on your network configuration, you can just copy the appropriate format
out of your Linux /etc/rc.d/rc.inet1. For my network, the lines that
have to be added are:
/etc/ifconfig eth0 128.100.75.111 broadcast 128.100.75.0 netmask 255.255.255.0
/etc/route add -net 128.100.75.0 netmask 255.255.255.0
The IP# in the ifconfig entry is that of the MS-DOS machine.
Now, copy this file into /tape144/etc/rc.d/rc.inet1-l, and change the
IP# in the new file to reflect that of the Linux machine rather than the
MS-DOS machine.
Next, clip out lines 3 to 11 of /tape144/etc/rc.local. That's an if
statement which executes the rc.inet* files. We don't want this to
happen during the bootup.
Create a new file: /tape144/root/.rhosts containing the line:
linux root
where, again, "linux" is replaced with the full machine name (including
domain) or the IP# of the Linux machine.
Fill in the password field in /tape144/etc/passwd for the root login
to keep people from logging onto the MS-DOS machine while you're doing
the backup. You can do this by copying the corresponding field from your
Linux machine's /etc/passwd file.
Copy /usr/bin/rsh into /tape144/usr/bin.
Copy the following files from /usr/etc into /tape144/usr/etc:
in.rshd
rpc.mountd
rpc.nfsd
rpc.portmap
services
tcpd
Create a new script, /tape144/bin/tapesetup, which consists of the
following: (change "linux" to reflect your Linux machine name).
=== BEGIN /tape144/bin/tapesetup ===
#! /bin/sh
/bin/sh /etc/rc.d/rc.inet1
/bin/sh /etc/rc.d/rc.inet2
/bin/mount linux:/nfs /mnt
/bin/insmod /mnt/ftape.o
=== END /tape144/bin/tapesetup ===
Next, create another new script, /tape144/bin/msdosset, as follows:
(change "linux" to reflect your Linux machine name).
=== BEGIN /tape144/bin/msdosset ===
#! /bin/sh
/bin/sh /etc/rc.d/rc.inet1
/bin/sh /etc/rc.d/rc.inet2
mount linux:/mnt /mnt
/bin/insmod /mnt/ftape.o
=== END /tape144/bin/msdosset ===
Create a readable file, /tape144/root/notes which contains this
helpful information for use in full recovery:
=== BEGIN /tape144/root/notes ===
For a full recovery to a trashed hard disk, boot the Linux machine with
the SAR disks #1 and #2 then type the following:
/bin/sh /etc/rc.d/rc.inet1-l
/bin/sh /etc/rc.d/rc.inet2
/usr/etc/rpc.portmap
/usr/etc/rpc.mountd
/usr/etc/rpc.nfsd
Next, insert SAR disk #3 and type:
mount /dev/fd0 /mnt
Create a new mount point, with:
mkdir /mnt2
and mount your Linux hard disk partition on this point. You may have to
reformat the partition first, if so, follow the directions in the Linux
Installation HOWTO. The SAR disks contain all the files necessary to do
the reformat.
Finally, use disks SAR#1 and SAR#2 to boot up the MS-DOS machine and run
the /bin/msdosset script on that machine. It will take about a minute to
run that script because it is getting an NSF file from a floppy drive, so
be patient. Now, recover the tape to /mnt2 on the Linux machine.
=== END /tape144/root/notes ===
If you are using the backup scripts you will need to copy 'afio' into
the /tape144/local/bin subdirectory. It is not necessary to have the rest
of the backup script files on the recovery disks, an archive can be
recovered using on