How to restore a backup (on sun and hp)

Staffan Ohlsson (ohlsson@esrf.fr)
Tue, 19 Jan 1999 14:59:04 +0100 (MET)

Hi,
There has been questions from you Blissers : How do I restore data
on my beamline ?

It is not easy. So far I have put one person per beamline on a
"backup/restore" training.
Please look at
http://www.esrf.fr/computing/cs/sysadmin/
unix/restricted/reports/bl-info.html
to see if you have someone close to you, that can explain it for you

If you need to do it during the night or at some hour when the
responsable is not there, then you might be helped on
the format of the tape.

The format follows a "table" file.

To check your table-file, please log in to the host with the
tape station and do
# crontab -l | grep backup
0 22 * * * /usr/local/etc/backup/backup -m root -m rasmussen@esrf.fr \
-m lescar@esrf.fr -m grimes@embl-grenoble.fr -table \
/usr/local/etc/backup/crys5-table
(In this case it is /usr/local/etc/backup/crys5-table)
# cat /usr/local/etc/backup/crys5-table (look at it)
-- Here is an example file without the comments (not the real one) ----
insert tape crys5 /dev/rmt/c1t0d0BESTnb 2 ...
crys5 /users crys5 /dev/rmt/c1t0d0BESTnb 2 0
crys5 / crys5 /dev/rmt/c1t0d0BESTnb 2 0
crys5 /stand crys5 /dev/rmt/c1t0d0BESTnb 2 0
crys5 /var crys5 /dev/rmt/c1t0d0BESTnb 2 0
crys5 /opt crys5 /dev/rmt/c1t0d0BESTnb 2 0
crys5 /usr crys5 /dev/rmt/c1t0d0BESTnb 2 0
crys3 /users crys5 /dev/rmt/c1t0d0BESTnb 2 0
crys3 / crys5 /dev/rmt/c1t0d0BESTnb 2 0
crys3 /stand crys5 /dev/rmt/c1t0d0BESTnb 2 0
crys3 /var crys5 /dev/rmt/c1t0d0BESTnb 2 0
crys3 /opt crys5 /dev/rmt/c1t0d0BESTnb 2 0
crys3 /usr crys5 /dev/rmt/c1t0d0BESTnb 2 0
insert tape crys5 /dev/rmt/c1t0d0BESTnb 3 ...
crys2 /users crys5 /dev/rmt/c1t0d0BESTnb 3 0
crys2 / crys5 /dev/rmt/c1t0d0BESTnb 3 0
crys2 /stand crys5 /dev/rmt/c1t0d0BESTnb 3 0
crys2 /var crys5 /dev/rmt/c1t0d0BESTnb 3 0
crys2 /opt crys5 /dev/rmt/c1t0d0BESTnb 3 0
crys2 /usr crys5 /dev/rmt/c1t0d0BESTnb 3 0
crys7 / crys5 /dev/rmt/c1t0d0BESTnb 3 0
crys5 /users crys5 /dev/rmt/c1t0d0BESTnb x x
crys3 /users crys5 /dev/rmt/c1t0d0BESTnb x x
crys2 /users crys5 /dev/rmt/c1t0d0BESTnb x x
crys7 / crys5 /dev/rmt/c1t0d0BESTnb x x
-----
This means that at 22:00 on tuesday there is a full backup of
crys5, crys3. On wednesday there is a full backup of crys2 and crys7
On thursday up until monday there are incremental backups.

This scheme will produce two tapes : one done on tuesday night and
ejected after the full backup. The other is started on wednesday night
and goes until monday night. On monday night after the last incremental
it is ejected.

Each time the cronjob "backup" runs there is first an ASCII file
that talks about the date. This is very important. If the date is not
Tuesday or Wednesday, the backup is corrupted and you need to check
another one.

After the ASCII file you will have a "vxdump" (if done on an HP) or
a "ufsdump" (if done on a SUN) file for each file-system.

This is how the Wednesday tape look like
File No. Type of contents
1 ASCII (first one)
2 vxdump of /users on crys2
3 vxdump of / on crys2
4 dump of /stand on crys2 (this is an hfs file : see df)
5 vxdump of /var on crys2
6 vxdump of /opt on crys2
7 vxdump of /usr on crys2
8 ufsdump of / on crys7 (this is a Sun)
9 ASCII (new day)
10 vxdump of /users on crys5 (incremental)
11 vxdump of /users on crys3 (incremental)
11 vxdump of /users on crys2 (incremental)
12 ufsdump of / on crys7 (incremental
13 ASCII (new day)
14 vxdump of /users on crys5 (incremental)
15 vxdump of /users on crys3 (incremental)
16 vxdump of /users on crys2 (incremental)
17 ufsdump of / on crys7 (incremental
... etc... until ejected

--- On SUN all files are backed up with ufsdump
--- On HP all but /stand are backed up with vxfsdump (/stand is done with dump)

+++++++++++++++++++++++++++++++++++++++++++++++++++++
The ASCII files are read as :
# cat /dev/rmt/c1t0d0BESTnb
EXPG backup system : host crys5 on Tue Jan 19 22:00:02 MET 1999

+++++++++++++++++++++++++++++++++++++++++++++++++++++
The vxfsdump you read back as
# cd /tmp
# vxrestore -ifb (crys5:)/dev/rmt/c1t0d0BESTnb 64
vxrestore> add opid02/myfile
vxrestore> extract
You have not read any tapes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
set owner/mode for '.'? [yn] n
vxrestore > quit

-- Comments :
+ you need to advance the tape by
mt -t /dev/rmt/c1t0d0BESTnb rew (as root on crys5)
mt -t /dev/rmt/c1t0d0BESTnb n (n = from table file)
( n=15 for /users 2nd incremental on crys2)
+ you need to have an rhosts relationship set up if you use
vxrestore -ifb crys5:/dev/rmt/c1t0d0BESTnb 64
+ the file opid02/myfile will appear as /tmp/opid02/myfile
in the example above.

+ WARNING : never answer "y" on
set owner/mode for '.'? [yn]
In this case you will set /tmp with the owner/mode as /users where
set => machine stops working !!!

+ to find the files on the backup you can do "ls" and "cd" before
doing "add". You can use wildcard adds or add an entire directory
Please do "?" on prompt

+++++++++++++++++++++++++++++++++++++++++++++++++++++
The ufsdump you read back as
# cd /tmp
# ufsrestore -ifb (crys5:)/dev/rmt/c1t0d0BESTnb 128
ufsrestore> add opid02/myfile
ufsrestore> extract
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
set owner/mode for '.'? [yn] n
ufsrestore > quit

The same comments on ufsrestore is valid for vxrestore
+++++++++++++++++++++++++++++++++++++++++++++++++++++

I hope this document will help you when in panic...

S Ohlsson