University Computing Systems
Systems Administration - NetBackup restores
This document outlines the procedures and scripts needed to successfully perform
restores from backups taken through NetBackup.
When a restore is needed it is important to use the proper method for restoring
the data; the method to use depends on the backup type that is being restored.
There are two types of restores, restoring local data, including a full restore
and recovery of the entire Operating System and restoring AFS data.
All script templates listed in this document can be found in :
/afs/cad/admin/NetBackup/scripts
Restoring local data
All commands listed in this section must be performed from the client that
needs the restore or from ucsrestore1.njit.edu. In most cases the restore will
be done from the original client unless a full system restore is needed, then
it should be run from ucsrestore1.njit.edu.
NOTE: ucsrestore1.njit.edu has the permission to restore data from any UCS
client but does not have permission to restore to any client other than itself.
Before beginning the restore process, create a working directory on the machine
that will hold the restore scripts, planfile, renamefile, and restore logs.
The practice is to use :
/export/restore/${client}; where client = the name of the client
being restored.
Copy all NetBackup restore template scripts from /afs/cad/admin/NetBackup/scripts
to your newly created work area, a simple cp command would work, but this example
uses rsync.
rsync -avz /afs/cad/admin/NetBackup/scripts /export/restores/${client}-restore
The first thing to do is to identify the backup that you would like to use for
the restore. The show.backups.sh script can be used to list the backups that
are available for a restore.
The following example displays a list of backups taken for oak :
# show.backups.sh oak.njit.edu
Backed Up Expires Files KB C Sched Type Policy
---------------- ---------- -------- ----------- - ------------ ------------
09/07/2006 20:02 09/21/2006 1436 6913440 N Incr Backup EC-Servers-3
09/06/2006 22:14 09/20/2006 457 4025600 N Incr Backup EC-Servers-3
09/05/2006 20:33 09/19/2006 383 4584352 N Incr Backup EC-Servers-3
09/04/2006 20:02 10/05/2006 85488 7110432 N Full Backup EC-Servers-3
09/03/2006 20:03 09/17/2006 341 4592704 N Incr Backup EC-Servers-3
09/02/2006 20:03 09/16/2006 304 3790048 N Incr Backup EC-Servers-3
09/01/2006 20:02 09/15/2006 413 3313312 N Incr Backup EC-Servers-3
08/31/2006 20:02 09/14/2006 476 4045632 N Incr Backup EC-Servers-3
08/30/2006 20:01 09/13/2006 357 3601888 N Incr Backup EC-Servers-3
08/29/2006 20:01 09/12/2006 401 4180896 N Incr Backup EC-Servers-3
08/28/2006 20:13 09/28/2006 85288 6701600 N Full Backup EC-Servers-3
08/27/2006 20:06 09/10/2006 296 3494304 N Incr Backup EC-Servers-3
08/26/2006 20:06 09/09/2006 301 4111488 N Incr Backup EC-Servers-3
08/25/2006 20:01 09/08/2006 339 3819392 N Incr Backup EC-Servers-3
08/21/2006 20:02 09/21/2006 85840 6496608 N Full Backup EC-Servers-3
08/14/2006 20:05 08/14/2007 85867 7202816 N Full Backup EC-Servers-3
07/17/2006 20:09 07/17/2007 92919 11117184 N Full Backup EC-Servers-3
06/19/2006 20:07 06/19/2007 95245 17727168 N Full Backup EC-Servers-3
05/22/2006 20:02 05/22/2007 95039 17359712 N Full Backup EC-Servers-3
04/24/2006 20:25 04/24/2007 94875 16838304 N Full Backup EC-Servers-3
03/27/2006 20:34 03/27/2007 94858 15994048 N Full Backup EC-Servers-3
02/27/2006 20:01 02/27/2007 94795 15235360 N Full Backup EC-Servers-3
01/30/2006 20:42 01/30/2007 94721 15064672 N Full Backup EC-Servers-3
01/02/2006 21:13 01/02/2007 94443 14617760 N Full Backup EC-Servers-3
12/05/2005 21:47 12/05/2006 94428 14178688 N Full Backup EC-Servers-3
11/07/2005 20:59 11/07/2006 91149 13389984 N Full Backup EC-Servers-3
10/10/2005 20:45 10/10/2006 87793 13666144 N Full Backup EC-Servers-3
09/12/2005 20:28 09/12/2006 87710 13037728 N Full Backup EC-Servers-3
If for some reason you wanted to list a particular file located within a certain
backup image, it’s possible to do this using the show.backups.list.sh script.
Using the above script we can list all backups taken of guest23’s
mail file.
# show.backups.list.sh oak.njit.edu /var/mail/guest23
-rw------- guest23 mail 908722 Sep 06 22:14 /var/mail/guest23
-rw------- guest23 mail 415451 Sep 04 20:02 /var/mail/guest23
-rw------- guest23 mail 415451 Aug 29 20:01 /var/mail/guest23
-rw------- guest23 mail 408156 Aug 28 20:13 /var/mail/guest23
-rw------- guest23 mail 365033 Aug 14 20:05 /var/mail/guest23
-rw------- guest23 mail 342062 Jun 19 20:07 /var/mail/guest23
-rw------- guest23 mail 318899 May 22 20:02 /var/mail/guest23
-rw------- guest23 mail 297340 Apr 24 20:25 /var/mail/guest23
-rw------- guest23 mail 238612 Mar 27 20:34 /var/mail/guest23
-rw------- guest23 mail 236369 Feb 27 2006 /var/mail/guest23
-rw------- guest23 mail 236369 Jan 30 2006 /var/mail/guest23
-rw------- guest23 mail 236369 Jan 02 2006 /var/mail/guest23
-rw------- guest23 mail 227985 Dec 05 2005 /var/mail/guest23
-rw------- guest23 mail 180797 Nov 07 2005 /var/mail/guest23
-rw------- guest23 mail 109978 Oct 10 2005 /var/mail/guest23
-rw------- guest23 mail 3504049 Sep 12 2005 /var/mail/guest23
The above is particularly useful when trying to restore a file from a particular
time period. In most cases this step will not be needed.
So let’s say we needed to restore /var/mail from the most recent full
backup.
First create the bprestore.fileplan file which tells NetBackup what
it is that we are asking to have restored. In this case its one simple line :
#--bprestore.fileplan
/var/mail
#--
If restoring to an alternate location such as /export/var/mail then
create a bprestore.rename file that would look like this :
#--bprestore.rename
change /var/mail to /export/var/mail
#--
Next modify the doit.sh script which will be used to initiate the
actual restore.
The following variables found in doit.sh should be modified accordingly
FROMCLIENT="client.njit.edu"
TOCLIENT="client.njit.edu"
OTHEROPTS="-s 09/04/2006 -e 09/07/2006"
FROMCLIENT - This variable lists the name of the client for which backups are
needed, i.e., the name of the machine which data is being
restored from.
TOCLIENT - This is the name of the client where data is being restored
to. This will often be the same as the FROMCLIENT but in cases
where the restores are being done from another system, such as
ucsrestore1.njit.edu, the system that is running the restore
would be specified here.
OTHEROPTS - Other options that need to be passed to bprestore are listed
here. The -s option list the starting date to use for the
restore (09/04/2006) and the -e option lists the end date
for the restore (09/07/2006).
After the doit.sh script has been modified, execute doit.sh to begin the
restore. At this point its a good idea to tail the logfile created by doit.sh
to determine if any tapes need to be loaded into a tape robot.
If tapes needed for the restore are required to be loaded into a tape robot
then an email should be sent to csd-ebs-ops@listserver.njit.edu indicating that
a restore has been initiated and a tape request is pending.
If a tape is needed for a restore, there is a 99% chance that the required tape is
located off-site and will need to be requested from our off-site tape vault. For non
critical restores the requested tapes should arrive within one day. Once the
needed tapes have arrived, a notification will be sent to you indicating that the
tapes have been loaded into the robot libraries. It may be necessary to resubmit
the restore request as restores waiting for tapes will timeout after about twelve
hours if the required tapes are not loaded.
After the restore is complete, notify csd-ebs-ops@listserver.njit.edu indicating
that tapes can be returned to the off-site vault location.
Restoring AFS Volumes
The procedure for restoring AFS data is similar to restoring local data but is
slightly different. The differences involved with performing an AFS restore
are outlined here.
Unlike local backups that can be restored from ucsrestore1.njit.edu, AFS backups
can only be restored by the fileserver in which they are to be restored to.
Also, unlike local backups you cannot restore an individual file, only
individual volumes can be restored.
The example that will be used here will restore the user volume user.guest23
from fileserver pure located on partition /vicepf but to a different name
located on pure /vicepf.
Before beginning the restore process, create a working directory on the machine
that will hold the restore scripts, planfile, renamefile, and restore logs.
The practice is to use :
/export/restore/${volume}; where volume = the name of the AFS
volume being restored.
All script templates can be found in :
/afs/cad/admin/NetBackup/scripts
Next, the show.afs.backups.sh script can be
used to list the AFS backup images on pure.
The AFS policy names that are used for the AFS backups may look a bit confusing
at first glance, but they do have a meaning. When show.afs.backups.sh is run,
its hard not to notice that there are lots of oddly named backup images.
These backup images can be represented by the following regex :
NJIT-UCS-UNIX-PROD-AFS-VOL-(USER|RSRCH)?-?[A-Z]\+[A-Z](\+[A-Z])?
Volumes that contain the prefix ’user’ will be listed as :
NJIT-UCS-UNIX-PROD-AFS-VOL-USER-[A-Z]\+[A-Z](\+[A-Z])?
Any volume which is prefixed with research will be listed as :
NJIT-UCS-UNIX-PROD-AFS-VOL-RSRCH-[A-Z]\+[A-Z](\+[A-Z])?
All other volumes will be listed as :
NJIT-UCS-UNIX-PROD-AFS-VOL-[A-Z]\+[A-Z](\+[A-Z])?
The following can be used to find the backup images which contain the
volume user.guest23. The volume is located on fileserver pure on vicepf.
show.afs.backups.sh pure.njit.edu | \
egrep ’NJIT-UCS-UNIX-PROD-AFS-VOL-USER-[A-Z]\+[A-Z](\+[A-Z])?’ | \
egrep ’F(\+|\-)’
The above command should produce the following :
09/07/2006 22:44 09/21/2006 3 18720 N Incr Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
09/05/2006 23:45 09/19/2006 1 2656 N Incr Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
09/03/2006 23:53 10/04/2006 3 20000 N Cinc Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
09/03/2006 04:53 09/17/2006 1 2656 N Incr Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
08/31/2006 22:50 09/14/2006 2 6784 N Incr Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
08/30/2006 00:03 09/13/2006 3 19520 N Incr Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
08/28/2006 06:44 10/29/2006 10 18353888 N Full Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
08/20/2006 22:35 09/20/2006 3 9571040 N Cinc Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
08/13/2006 22:39 08/13/2007 9 8785504 N Full Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
07/30/2006 22:31 09/30/2006 8 8540992 N Full Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
07/17/2006 07:30 07/17/2007 8 8383392 N Full Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
06/19/2006 04:07 06/19/2007 11 9500160 N Full Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
05/22/2006 07:34 05/22/2007 11 9505248 N Full Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
04/24/2006 03:20 04/24/2007 11 9412160 N Full Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
03/27/2006 17:59 03/27/2007 11 9369216 N Full Backup NJIT-UCS-UNIX-PROD-AFS-VOL-USER-F+O+X
The above report can be used to ascertain the last full backup of /vicepf, which
according to the above, occurred on 8/28/2006 with incrementals occurring on 8/30,
8/31, 9/03, 9/05 and 9/07.
The date range for the restore would then be specified as :
" -s 8/28/2006 -e 9/07/2006"
which would be added to the OTHERARGS variable in the doit.afs.sh script.
Next, create the bprestore.fileplan file containing the volume name for the
volume that is to be restored, in this case, user.guest23.
AFS volumes to be restored are always specified with /AFS as the prefix along
with the AFS server that the volume was located on at the time of the backup,
followed by the vice partition the volume was located on, then the name of the volume.
#--bprestore.fileplan
/AFS/pure.njit.edu/vicepf/user.guest23
#--
Since the AFS volume will be restored to a different name, a rename file is
needed.
#--bprestore.rename
change /AFS/pure.njit.edu/vicef/user.guest23 to /AFS/pure.njit.edu/vicepf/user.guest23.res
#--
The above rename file tells NetBackup to restore the AFS user volume
user.guest23 as user.guest23.res on fileserver pure to /vicepf
At this point the doit.afs.sh script should be modified accordingly. This
script is very similar to the doit.sh script used in the restore of
local data in the previous section except it contains information to tell
NetBackup that the restore being done is an AFS volume and not a regular
restore. The following should be modified accordingly
FROMCLIENT - This should be set to the AFS fileserver that the volume was
originally located on, in this case pure.njit.edu
TOCLIENT - This needs to be set to the AFS fileserver that the volume is
is being restored to, which again happens to be pure.njit.edu
OTHEROPTS - The date range that is to be used for the backups, which was
determined using the show.afs.backups.sh script, is specified
here. The range for our restore will be " -s 8/28/2006 -e 9/07/2006"
The restore can be now initiated by executing the doit.afs.sh script.
If tapes are needed for the restore, follow the procedure outlines in the
first section on requesting tapes from off-site.
Last updated: 5/11/2007