How to back up your UNIX project disk at FNAL
Using Computing Divisions ocs and fmb packages, I (John Krane) have written
a set of scripts to let you back up your disk drives with a few
keystrokes each week. The data from your disk drive(s) will
be copied to tapes you place in the permanent tape vault at
the Feynman Computing Center.
Here's how:
- Acquire some 8mm "exabyte" tapes and official tape label names
(called VSN's).
As an example, Lee Lueking has taken on the responsibility
of assigning tape names for all of DZero. If you are a member
of DZero, send your request to Lee (lueking@fnal.gov) with the
following info:
- Reason for request (Monte Carlo, data storage, etc)
- Maximum number of tapes needed (please let him know
if the number of tapes may increase in the near future).
- Name/email/phone
- Label each tape on the edge with the VID, then label the top
of the tape with the following info:
- TAPE VID
- experiment name, group name
- your name
- your phone
- your email
- Fill out a vault request form (available at FCC or I have an
sample form).
To add your tapes to the FCC vault, go to the back side of the
FCC building. Looking from the parking lot, on the right side
of the building, proceed straight through the two sets of
doors, and go to the window. (You'll feel like you're ordering
take-out...) Just pick up the phone if nobody is there. (During construction at Feynman, use the door on the left side of the building, and then the phone by the door in front of you).
- Create a file .rhosts if you don't have one in your home
area already. Do man .rhosts at the command line for
more info. This file will (among other things) let you do
backups of disks that are mounted on one machine but are
accessible to all machines; this step makes the NSF mounting
transparent to you. You will need this file on each machine
that has its own drive system. (At DZero, you want to put
the file in your home areas on d0cha or d02ka.)
- Create a directory (on d0cha or d0mino) from which you wish to
operate the scripts. Add the line setup kback to your
.login file (do it at the command line also, first time).
- From your backup directory, create a logs subdirectory,
then copy the input file to your area:
mkdir logs
cp $KBACK_DIR/x_backup.input
- Edit x_backup.input to reflect your information instead of
the example. This is self-explanatory if you look at the file.
You need LSF batch privileges to run the script in its
current form. (All I mean is: you need to be able to submit
batch jobs to a queue.) If you don't have LSF privs, you
should request them from D0 Operations Team (d0-team@fnal.gov). Congratulations, you are now ready to use the utility!
- When you run with brand new tapes, you must label them first.
Go to your backup directory and type klabel to assign
the internal ID of each tape to match its external VSN.
This is automated and extracts the info from your x_backup.input.
It will take several hours to cycle through several tapes,
log files will appear in your log directory or you can monitor
the batch jobs with bjobs, bpeek etc.
- When you want to back up the drives that you listed in the input
file, go to your backup directory and type
kback 1
The 1 argument backs up all drives on your sequence 1 tapes.
A 2 would give you sequence 2. You can add sequence 3 or 4
lists to x_backup.input if you wish. If you want redo a single
tape's backup (because of an odd failure, for instance), type
kback x prqy99
The x says to back up only one tape. The prqy99 is an example
of a tape VSN. Replace it with your VSN when you do this command!
The script will search through the input file and put the proper
data on that tape.
The scripts put a file called .lastfull.d0cha (or d0mino, etc) in
the top of each main directory it backs up. This indicates to
everyone the date of the last full backup. If you don't have
privilege to write to a directory you backup, you'll get an
error message to that effect in the log file, but the backup
will be successful.
The scripts will send you mail as they finish. Always check the
logfiles for funny errors. The scripts attempt to self-diagnose,
but somebody needs to look at the file.
If you want to monitor the progress of your jobs, try the commands
bjobs (get a list of your batch jobs, running and pending),
bpeek n (look at output of batch job number n), and
ocs_tape (list tape drives available on this machine and who
is using them).
Questions? Send mail to John Krane (jkrane@fnal.gov). Want to look at the scripts yourself?
After you setup kback, look in $KBACK_DIR . Have some suggested
changes? Definitely let me know.
John Krane (jkrane@fnal.gov)
Version history
v1.0 Official release, scripts will:
- double-check tape label is correct one (we don't
want to overwrite somebody else's tapes!)
- check that tape is write-enabled
- check for any other tape-load failure
- copy the requested files from disk to tape
The scripts will not:
- check to make sure the requested files will fit
on the tape
- spill over to another tape
- submit themselves based on what day it is
(write your own cron job if you want)
v2.0 Many little fixes to handle exceptional cases:
- can now back up cha drives from 2ka, and vice versa.
- removed _err files, now error logs are in
one main log file.
- can now handle >10 tapes per set (thanks V.Sorin).
- diagnoses tape drive failure.
Common problems
- rsh error: Your .cshrc or .login files echo text to the
screen. This will cause rsh commands to fail. Remove
these echo commands from the files or put them in if-then blocks as in the man pages for rsh.
- Cannot open #blah#: Emacs won't let you read files with
the # on them. Fmb doesn't seem to ignore these files,
despite having a mechanism to exclude them in principle.
- No space left on device: You are trying to put too much
stuff on one tape. Divide the disk into sets and put it
on several tapes.
- /bin/sh: /mydirectory: permission denied: Sombody has
set their directory so the group can't look in there...
including your batch job. Have them chmod a=+rwx or
something similar and try again.
Any questions or problem reports should be reported to the
D0 Operations Team
(d0-team@fnal.gov)
Last modified: Wed Aug 25 17:15:53 CDT 1999