NetWorkerAFS - highly automated AFS backups using Legato NetWorker ** NetWorkerAFS is not a complete solution *** ** The University of Wisconsin Physics Department is now using TiBS ** Description: ------------ This package automates the backing up of AFS volumes via Legato NetWorker. It uses the AFS-native "vos dump", "vos restore" and "fs mkmount" commands. The "nsrafs" script prepares AFS file servers and their NetWorker servers for NetWorkerAFS backups. On each AFS file server, it does two things: 1) it maintains a hashed directory tree of stub files that represent AFS volume backups, and 2) it maintains the NetWorker client save set resource for that server. Therefore, backups are done by volume name, new AFS volumes are automatically backed up, and removed AFS volumes are automatically removed from save set lists. The "nsrasm" script implements a "NetWorker application specific module"--it's the glue between NetWorker and AFS. The "nsr2afs" script is a wrapper around "vos dump" and "vos restore". It also saves/restores various volume attributes: volume name, file server, partition, and mount points. In between "nsrasm" and "nsr2afs" is the NetWorker "nsrfile" command. When saving volumes, it encodes volume attributes and "vos dump" data into NetWorker's "save stream" format. When restoring volumes, it decodes volume attributes and "vos dump" data. Download: --------- Refer to ftp://noc.hep.wisc.edu/pub/src/NetWorkerAFS/ Installation: ------------- Do "./configure". Do "make install" as root. This will install nsrafs, nsrasm and nsr2afs in the directory that has the NetWorker client executables. Do "make install.config" as root. This will copy "nsrafs.cf" and "nsrafs-vol2mp.pl" into /etc. Configuration: -------------- 1) Edit the /etc/nsrafs.cf file. At the very least, you'll need to set cell_name and networker_server. 2) Edit /etc/nsrafs-vol2mp.pl so that nsrafs will map volume names to mount points following your cell's mapping conventions. Also add $mp =~ s/\.backup//; so that .backup isn't included in mount points. 3) Configure the NetWorker server to backup the AFS file server's (non-afs) file systems. 4) Configure the NetWorker server to allow your AFS file server to update it's save set list. This is done by adding "root@fileserver" to the NetWorker server's "administrator" list. 5) Run the nsrafs script. The first time it's run, it will print out a lot of output telling you about how it's created the tree of stub files and revised the AFS file server's save set list. 6) Configure cron to run "nsrafs -mail root" (or something like that) sometime before NetWorker runs it's save group. Caveats: -------- The "vos dump" command marks volumes as busy. When volumes are busy, all writes block until the "vos dump" completes. This is a bad thing. To avoid this, run "vos backupsys" and use NetWorkerAFS to backup the resulting .backup volumes. To restore a volume, you need to recover the full stub file and then recover the inc stub file N times--once for each incremental backup. There should be a script to automate this procedure, but it has not been written. The general idea is to do something like mminfo -ot -v -c client -N /v/bucket/some.volume.backup and use the tail of the resulting output to generate a set of recovers like so recover -iR -t '' -a /v/bucket/some.volume.backup/full recover -iR -t '' -a /v/bucket/some.volume.backup/inc [...] recover -iR -t '' -a /v/bucket/some.volume.backup/inc You can not conveniently restore a volume to a different server and/or partition. Currently the only way to change the server or partition is to hardcode that data in the restore section of the afs2nsr script. If you want to restore a volume that exists, use "recover -iR". This will cause NetWorkerAFS to create "some.volume.R". Doing "recover" and then "relocate" does not work. If you want to overwrite a volume or mount point, remove it before doing the appropiate NetWorker recover. NetWorkerAFS will not overwrite volumes nor will it overwrite mount points. Doing bos restart during backups may cause "vos dump" to crash. Disable the default automatic restarts with the "bos setrestart" command. Doing "vos backup" or "vos backupsys" during a save or recover may cause the save or recover to crash. Don't do that. (Remember to disable your "vos backupsys" when you're doing big restores.) If you want debug info, set $debug = 1 in the afsasm and afs2nsr scripts. This will result in debug messages being written to /var/log/afsasm.log The nsr2afs script "knows" about .backup volumes: when restoring them, it will restore them without the .backup suffix. When doing recovers, the response to the interactive overwrite/rename prompt is ignored. This appers to be a bug in nsrfile. Use the "-i" flag instead. When doing overwrite recovers, nsrfile removes the corresponding the stub files. The re-create the corresponding stub files, simply run nsrafs. Disaster Recovery: ------------------ The general idea is 1) install OS from vendor media 2) install AFS 3) install NetWorker 4) install NetWorkerAFS 5) recover (at least) /usr/vice and /usr/afs 6) start AFS services 7) recover -s networker_server -a /v This procedure has not been tested. Contact: -------- steve rader systems & network manager high energy physics university of wisconsin $Id: README,v 1.7 2005/09/20 19:28:52 rader Exp rader $