COHERENT manpages

This page displays the COHERENT manpage for restor [Restore file system].

List of available manpages
Index


restor -- Command

Restore file system
restor command [dump_device] [filesystem] [file ...]

restor copies to the hard disk one or more files from floppy disks or tapes
written by the command dump.

restor recognizes the following commands:

r  Mass  restore  both  full  and  incremental  dump disks/tapes  into  the
   filesystem. The  target file system must have enough  data blocks and i-
   nodes to hold the dump.

   The mass  restoration is performed in three phases.   In phase 1, restor
   clears all i-nodes  that were either clear at dump  time or are going to
   be restored.   Any allocated blocks  are released.  Second,  it restores
   all  files on  the disk.   The i-numbering  is preserved;  however, data
   blocks are  allocated in  the standard fashion.   Third, a pass  is made
   over  the i-nodes  and the  list of  free i-nodes  in the  superblock is
   updated.

   Restoration  begins immediately,  using  the currently  mounted disk  or
   tape.

R  Like the r command, except that it pauses to ask for numbers of disks or
   reels.

t  Read the  header from the dump.   Display the date the  dump was written
   and the ``dump since'' date that produced the dump.

x  Extract each  file from the dump  and restore it to  the hard disk.  All
   file names are absolute path names starting at the root of the dump (the
   first directory  dumped, which is always the root  directory of the file
   system).  A numeric  file name is taken to be  an i-number on the dumped
   file system, permitting restore by i-number.

   restor looks up each argument file in the directories of the dumped file
   system  and  prints  out  each  name  and associated  i-number.   restor
   extracts the  files from  the currently mounted  dump disk or  tape, and
   writes the extracted  files into the current directory.  Extracted files
   are named after their i-numbers.

X  Like command x, except that before it begins, it asks you for the number
   of the disk (or the reel  number of the dump tape).  It continues asking
   for  dump  disks  until all  files  have  been  extracted  or you  types
   <ctrl-D>.

Each of the above commands can  be modified either or both of the following
modifiers:

f  Tell  restor to  take the  next argument  as the path  name of  the dump
   device  (floppy-disk drive  or tape  drive).  If the  f modifier  is not
   specified, restor uses the device /dev/dump.

v  Verbose  output.   Tell restor  to  print a  step-by-step  trace of  its
   actions when  restoring an entire file system.   This is for discovering
   what went wrong when a mass restore runs into trouble.

Restoring from a Damaged Medium

As noted below, dump requires that  its output be written to disks or tapes
that are free of defects.  Restoring a file system from a damaged medium is
difficult and  is not  associated with a  high probability of  success; if,
however, you  must try to do  so, the following directions  will give you a
fighting chance of restoring your data.

1. Use  the command  fdformat  to format  a  blank disk.   Use the  command
   badscan to examine it for bad  sectors; if it does have bad sectors, put
   it aside and try another.

2. Use the command dd to copy  the bad disk to directory /tmpfoo1 dd should
   die at the bad sector in the disk.

3. dd again to directory /tmp/foo2 using that command's skip=n to skip past
   the bad sector (or sectors).

4. Repeat step  3 (if it  died too) until  the end of the  disk is reached.
   Now you  have a  set of  directories named /tmp/foo[1...n]  that contain
   parts of the bad disk.

5. Use the command

       dd if=/tmp/foo1 of=/dev/fha0

   with the new, defect-free disk.

6. Now, use the command

       dd if=/tmp/foo2 of=/dev/fha0 seek=whatever

   to place foo2 into the right place on the new disk.

7. Repeat 6 for each directory foo3 through fooN.

8. Create a 512-byte file that contain the string

       GARBAGE\n

   repeated  64 times.   Use dd  to  copy it  into new  disk where  the bad
   sectors were.

Now, you should have a disk that is a mirror image of the old, damaged dump
disk.  Each  bad sectors will  have been replaced  by 64 iterations  of the
string GARBAGE\n.   As noted, there  is no guarantee that  this scheme will
work in every  instance (the chances of error are  quite high), but it will
give you a fighting chance to save your data.

Files

/dev/dump -- Dump device
/etc/ddate -- Dump date file

See Also

commands,
dump,
dumpdir

Diagnostics

Most of  the diagnostics produced  by restor are  self-explanatory, and are
caused by internal table overflows or I/O errors on the dump medium or file
system.

If the  dump spans multiple  disks or reels,  restor asks you  to mount the
next disk at  the appropriate time.  Type a newline  when the disk has been
mounted.   restor verifies  that this  is the correct  disk, and  gives you
another chance if the disk number in the dump header is incorrect.

Notes

You cannot  perform a  mass restore onto  a live root  partition.  Instead,
boot a stand-alone version of COHERENT on a floppy-disk drive, or boot from
an alternative  COHERENT file system on  another hard-disk partition before
you attempt to do a mass restoration.

The handling  of tapes with multiple  dumps on them (created  by dumping to
the  no  rewind special  files)  is not  very  general.  Basically,  restor
assumes that tapes holding multiple dumps and tapes holding dumps that span
multiple reels are mutually exclusive.  You  can restore from any file on a
reel by positioning  the tape and then restoring with  the x or r commands,
which do not  reposition the tape.  It is (almost)  impossible to use the X
or R  commands, as the position  of the dump tape will  be lost when restor
closes it.

dump requires  that its  output be  written to disks  that are free  of bad
sectors.  If you  write a dump to a disk  with bad sectors, you will not be
able  to  restore  files  from  that  disk.  See  dump  for  directions  on
processing disks to ensure that they are free of bad sectors.