System Administration Guide, Volume 1

How to Restore Files Interactively

  1. Become superuser.

  2. Write-protect the tape.

  3. Insert the volume 1 tape into the tape drive.

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

    # cd /var/tmp

    To avoid conflicts with other users, you might want to create and change to a subdirectory, such as /var/tmp/restore, in which to restore the files.

    If you are restoring a hierarchy, you should restore the files in a temporary directory on the same file system where the files will reside, so you can use the mv command to move the entire hierarchy where it belongs after it is restored.

  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. (Optional) 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

    You must wait while ufsrestore performs its final cleanup.

  11. Quit the ufsrestore program.

    ufsrestore> quit

    You then see the shell prompt.

  12. Verify the restored files.

    1. List the restored files and directories.

      # ls -l

      A list of files and directories is appears.

    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

The following example extracts the files /etc/passwd and /etc/shadow from the backup tape.

# cd /var/tmp
# ufsrestore if /dev/rmt/0
ufsrestore> ls
 .cpr_config   etc/          lost+found/   sbin/         usr/
 TT_DB/        export/       mnt/          sccs/         var/
 b/            home/         net/          share/        vol/
 bin           kernel/       opt/          shared/       ws/
 dev/          lib           platform/     src/          xfn/
 devices/      license/      proc/         tmp/
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