System Administration Guide

How to Restore Files Interactively

  1. Become superuser.

  2. Write-protect the tape.

  3. Put the backup tape in the tape drive.

  4. Change to a directory that will be used to restore the files temporarily.


    # cd /var/tmp
    

    If you want to restore the files to a different directory, substitute the directory name for /var/tmp in this step.

  5. Use the ufsrestore command to start the interactive restoration.

    Some informational messages and the ufsrestore> prompt are displayed.


    # ufsrestore if /dev/rmt/n
    
  6. Create a list of files to be restored.

    1. List the contents of a directory.


      ufsrestore> ls directory
      
    2. Change to a directory.


      ufsrestore> cd directory-name
      
    3. Create a list of files and directories you want to restore.


      ufsrestore> add filename filename
      
    4. [Optional] If you need to remove a directory or file name from the list of files to be restored, use the delete command.


      ufsrestore> delete filename
      
  7. Turn on verbose mode to display the file names as they are being restored.


    ufsrestore> verbose
    
  8. Use the extract command after the list is complete.


    ufsrestore> extract
    

    The ufsrestore command asks you which volume number to use.

  9. Type the volume number and press Return. If you have only one volume, type 1 and press Return.


    Specify next volume #: 1
    

    The files and directories in the list are extracted and restored to the current working directory.

  10. To keep the mode of the current directory unchanged, enter n at the set owner/mode prompt.


    set owner/mode for `.'? [yn] n
    
  11. Quit the ufsrestore program.


    ufsrestore> quit
    

    The shell prompt is displayed.

  12. Verify the files are restored.

    1. List the restored files and directories.


      # ls -l
      

      A list of files and directories is displayed.

    2. Check the list to be sure all the files and directories you specified in the list have been restored.

    3. Move the files to the proper directories.

Example--Restoring Files Interactively

In this example, the files /etc/passwd and /etc/shadow are extracted from the backup tape.


# cd /var/tmp
# ufsrestore if /dev/rmt/0
ufsrestore> ls
.:
 .OWdefaults         bin         lib            sbin/
 .Xauthority         dev/        lost+found/    shared/
 .desksetdefaults    devices/    misc/          tmp/
 .fm/                etc/        mnt/           ufsboot
 .mailtool-init      export/     net/           usr/
 .openwin-init       home/       nfs/           var/
 .profile            hsfsboot    opt/           ws/
 .wastebasket/       kadb        proc/
 .xsun.pluto:0       kernel/
ufsrestore> cd etc
ufsrestore> add passwd shadow
ufsrestore> verbose
verbose mode on
ufsrestore> extract
Extract requested files
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
extract file ./etc/shadow
extract file ./etc/passwd
Add links
Set directory mode, owner, and times.
set owner/mode for `.'? [yn] n
ufsrestore> quit
#