home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / docs / howto / restoreAFile < prev    next >
Encoding:
Text File  |  1992-12-14  |  7.9 KB  |  170 lines

  1. Procedure for doing a restore (Revised: $Date: 92/06/10 13:15:42 $).
  2.  
  3. 0.  Summary
  4.  
  5.     /sprite/admin/restore -v [-n 6] [-r] -f /dev/rst05.nr /sprite/foobar
  6.  
  7.     This restores /sprite/foobar from tape rst05.  The -n flag specifies
  8.     a particular dump file on the tape.  The -r flag does the restore
  9.     relative to the current directory, rather than the original location.
  10.  
  11. 1.  The first thing you need to do is find a tape that contains
  12.     the file you want to restore.  A level zero dump is done once
  13.     a week (usually over the weekend) and contains all the files.
  14.     Level one dumps are done on the other days.  Each level one dump
  15.     contains all the files that have been modified since the last
  16.     level zero dump.
  17.  
  18.     The file /sprite/admin/dump/dumpdates contains a list of recent
  19.     dumps.  If you have created or changed the file since the latest
  20.     level zero, you can use a subsequent level one dump, otherwise
  21.     you should use the most recent level zero.
  22.  
  23.     Each line in /sprite/admin/dump/dumpdates has information
  24.     about a filesystem dump.  The first number is the tape number.
  25.     Starting from the end of the file and working forward, find the
  26.     tape number that corresponds to the filesystem that contains the
  27.     file you want to restore.
  28.  
  29.     If the dump was done in the last day or two, then the tape
  30.     that contains it may still be in the tape drive.  That is
  31.     the first place you should look.  The tape number is written
  32.     on the back of the tape, and should be visible when the tape
  33.     is in the drive.
  34.  
  35.     If it is not in the drive it is probably in Evans 608-2 in the
  36.     rack on the wall (over the map of the Middle East).
  37.  
  38.     There are two Exabyte drives, both in 608-2, attached to
  39.     Sassafras.  The top drive usually holds the tape for the daily
  40.     dumps.  Unless you're restoring from that tape, it's usually
  41.     better to use the (usually empty) drive beneath it.
  42.  
  43. 2.  If necessary, remove the tape that is currently in the exabyte:
  44.     Push the button on the drive.  The green light should go out
  45.     immediately.  The drive will whir for about 30 seconds or so, and
  46.     then the tape will pop out.
  47.  
  48. 3.  Put the dump tape into the exabyte.  Close the door.  The
  49.     drive will emit about 30 seconds of whirring noise, and then
  50.     the green light should come on.
  51.  
  52. 4.  If you are restoring files that you do not have write permission
  53.     for, you will need to run the restore as the super-user.
  54.  
  55.     You should login to sassafras to do the restore.  Remote login is
  56.     fine, but you should avoid logging out until the restore is
  57.     finished.
  58.  
  59.     Type `/sprite/admin.sun4/restore -v -f <device> <pathname>'.  
  60.  
  61.     The device names for the tape drives are /dev/rst04.nr (for the
  62.     drive labeled "target 4") and /dev/rst05.nr ("target 5").
  63.  
  64.     The path name should be a hard, absolute path.  It should not
  65.     contain any symbolic links.  If you specify a symbolic link, then
  66.     the link will be restored, but not the file it points to.  Be
  67.     especially careful about using ~ to mean your home directory.
  68.     This is often a symbolic link in the /users directory.  You should
  69.     use the hard path instead.
  70.  
  71.     The pathname can be a single file, a directory, or a
  72.     regular expression.
  73.  
  74.     The -v option to restore means `verbose' and will cause the
  75.     files to be listed as they are restored.  Once all your files
  76.     are restored you can kill the restore process.  This is often
  77.     convenient, since it can otherwise take several hours to scan
  78.     to the end of the tape.
  79.  
  80.     If you want to restore a file without overwriting a current
  81.     file of the same name, then you can use the -r option to restore.
  82.     This will cause the leading '/' to be stripped off the restored
  83.     files.  They will be restored relative to the current directory
  84.     instead of root.
  85.  
  86.     There are often multiple copies of a filesystem on a tape.  If
  87.     there is only one copy of a filesystem on a tape, then the
  88.     restore program will know which copy to use.  But since the
  89.     daily dumps are appended to the same tape for several days,
  90.     there are often multiple copies of a filesystem on a tape.  In
  91.     this case you need to tell the restore program which one you
  92.     want to use.  You can figure out which file to use by either
  93.     looking at the file /sprite/admin/dump/dumpdates, or by reading
  94.     the label on the tape.  You can read the label on the tape by
  95.     using the command `` dump -t -f <device> ''.  The file number
  96.     is the second number on each line.  Use that argument with the
  97.     -n option to restore to tell it which file to use.
  98.  
  99.     Here is an example.  Lets say you are using the tape drive on
  100.     allspice and the tape is already in the drive.  When you type
  101.     `` dump -t -f /hosts/allspice/dev/exabyte.norewind '' it prints
  102.  
  103.     108 01 1    7977882  Tue Jul  3 02:20:29 1990  /user1
  104.     108 02 1   10111764  Tue Jul  3 02:33:06 1990  /user2
  105.     108 03 1    2529351  Tue Jul  3 02:42:05 1990  /user4
  106.     108 04 1          0  Tue Jul  3 02:49:19 1990  /postdev
  107.     108 05 1    4471199  Tue Jul  3 02:53:57 1990  /mic
  108.     108 06 1   22500114  Tue Jul  3 03:17:54 1990  /sprite
  109.     108 07 1   11044107  Tue Jul  3 03:29:16 1990  /sprite/src
  110.     108 08 1   76187648  Tue Jul  3 03:41:55 1990  /sprite/src/kernel
  111.     108 09 1    7679234  Tue Jul  3 04:03:50 1990  /c
  112.     108 10 1      74240  Tue Jul  3 04:33:57 1990  /b
  113.     108 11 1    4330284  Tue Jul  3 05:25:10 1990  /X11
  114.     108 12 1          0  Tue Jul  3 05:33:02 1990  /X11/R3
  115.     108 13 1    1620000  Tue Jul  3 05:39:15 1990  /newroot
  116.     108 14 1   16934100  Tue Jul  3 06:03:20 1990  /scratch3
  117.     108 15 1     542694  Tue Jul  3 06:10:39 1990  /
  118.     108 16 1     496976  Tue Jul  3 06:35:44 1990  /tic
  119.     108 17 1   10336362  Wed Jul  4 06:16:53 1990  /user1
  120.     108 18 1   12253526  Wed Jul  4 06:29:19 1990  /user2
  121.     108 19 1    4762611  Wed Jul  4 06:40:44 1990  /user4
  122.     108 20 1     420875  Wed Jul  4 06:49:43 1990  /postdev
  123.     108 21 1   24229891  Wed Jul  4 06:56:17 1990  /mic
  124.     108 22 1   31474112  Wed Jul  4 07:21:02 1990  /sprite
  125.     108 23 1   22377767  Wed Jul  4 07:34:55 1990  /sprite/src
  126.     108 24 1  101965368  Wed Jul  4 07:49:05 1990  /sprite/src/kernel
  127.     108 25 1   21589264  Wed Jul  4 08:14:21 1990  /c
  128.     108 26 1      74240  Wed Jul  4 08:36:38 1990  /b
  129.     108 27 1   18857383  Wed Jul  4 08:55:40 1990  /X11
  130.     108 28 1     152091  Wed Jul  4 09:09:33 1990  /X11/R3
  131.     108 29 1    1620000  Wed Jul  4 09:18:28 1990  /newroot
  132.     108 30 1   17130708  Wed Jul  4 09:52:58 1990  /scratch3
  133.     108 31 1    1742978  Wed Jul  4 10:03:14 1990  /
  134.     108 32 1    2158018  Wed Jul  4 10:34:22 1990  /tic
  135.  
  136.     The first number on each line is the tape number.  So this must
  137.     be tape 108.  That number should also be written on the back of
  138.     the tape, and the tape box.  The second number is the file number.
  139.     These should be sequential numbers.  The tape label itself is the
  140.     0th file on the tape.  /user1 is the 1st file, /mic is the 2nd, etc.
  141.     The next number is the number of bytes the file contains.  The
  142.     next entry is the date and time the files were dumped.
  143.  
  144.     Let's say you want to restore the file /sprite/foobar from
  145.     the dump on July 3.  /sprite is the 6th file on the tape.
  146.     You should use the command:
  147.  
  148.     restore -v -n 6 -f /hosts/allspice/dev/exabyte.norewind /sprite/foobar
  149.  
  150.     If you want to restore the same file from the July 4 dump then
  151.     you should use the command:
  152.  
  153.     restore -v -n 22 -f /hosts/allspice/dev/exabyte.norewind /sprite/foobar
  154.  
  155.     The restore program will skip 22 files before invoking tar.
  156.  
  157.     When the tape drive is reading the tape the orange light next
  158.     to the green light will be on.  When it is done reading the
  159.     tape the orange light will go off, but the green light will
  160.     stay on.
  161.  
  162. 5.  Remove the tape, put it back in the correct box, and then put
  163.     it back where you got it from.
  164.  
  165.     If there was a tape in the drive when you started, make sure
  166.     you put it back when you are done.
  167.  
  168. 6.  For more information see the manual entries for `dump' and `restore'.
  169.  
  170.