recover.sh - Recovers files archived after last samfsdump
(1m) was taken
∕opt∕SUNWsamfs∕examples∕recover.sh
∕
mount_point
SUNWsamfs
The recover.sh
script
recovers files using the information in the
archiver log. This script can be useful in a disaster recovery situation when a file
system has been lost and is recovered from a saved samfsdump
(1m) file.
If files were archived for the first time after the dump was taken,
there is no record of them in the dump. This script can be used to reload
those files from the archive copy by using the star
(1m) program.
Edit the archiver log file and extract the relevant portion.
In this editing session, you should eliminate entries for second,
third, or fourth archive
copies from this file because otherwise the files are recovered multiple
times, which wastes time. You should also eliminate directory entries.
Directory entries are noted by a d
in field 12 of the archiver log.
After the file is edited, save the edited file to a temporary file. For
example, save this file to ∕tmp∕arlog.in
.
Copy the script from its default location to a temporary location.
Use a command such as the following to copy the script to a temporary location:
server# cp ∕opt∕SUNWsamfs∕examples∕recover.sh ∕tmp∕recover.sh
Edit a working copy of the script and modify it for your site.
Edit the copy and change the value of BLK_SIZE
from 128
to
the block size in kilobytes for the VSNs in question.
Run the recover.sh
script.
This creates a new script to actually do the work of
recovering the files.
In the following example, the Oracle HSM mount point is ∕sam1
.
server# ∕tmp∕recover.sh ∕sam1 ∕tmp∕arlog
If you have multiple drives and want to recover from more than one VSN at a time, you can split this script into pieces first. The following line appears at the end of the work for each VSN:
# ----------- end of files for vsn XXX ---------The
XXX
is replaced with the VSN's bar code label.
Create a temporary directory to which the recovered files can be written.
Create this directory in an Oracle HSM file system. Although this could be your mount point, it is probably better to recover to a temporary directory in the Oracle HSM file system first, and then move the files to their final location after recovery is complete and everything looks as expected. For example:
server# mkdir ∕sam1∕recover
Change to the temporary directory to receive the recovered files.
Use the cd
(1) command to change to the
directory in which you want the files recovered.
server# cd ∕sam1∕recover server# sh -x ∕tmp∕recover.out
Run the recover.out
script.
The ∕tmp∕recover.out
shell script is created in the previous step. It
can be used to recover all the files listed in the ∕tmp∕arlog.in
file.
Run the recover.out
script. If you have split the scripts, you may have
to run it multiple times.
Improper use of this script can damage user or system data. Please refer to the Disaster Planning and Recovery Guide or contact technical support before using this script.
If used with the SAM-Remote clients or server, the recovery must be performed on the server to which the tape library is attached.
Do not run multiple recovery scripts at the same time.
This script resides in the following location:
∕opt∕SUNWsamfs∕examples∕recover.sh