FS
Documentation

Backup3G/User Guide/Recovering Data

From Documentation

(Difference between revisions)
Jump to: navigation, search
Revision as of 10:37, 20 April 2006
Moff (Talk | contribs)
(Recovery Options)
← Previous diff
Revision as of 10:56, 20 April 2006
Moff (Talk | contribs)
(To Recover Files From a Known Backup)
Next diff →
Line 54: Line 54:
<br> <br>
=== To Recover Files From a Known Backup === === To Recover Files From a Known Backup ===
-This topic describes how to do a recovery when you know which media set contains+ 
-the files.+This topic describes how to do a recovery when you know which media set contains the files.
-If you don’t know which backup contains the correct versions of the files, you will+ 
-first need to search the media contents database or online indexes. See To Recover+If you don’t know which backup contains the correct versions of the files, you will first need to search the media contents database or online indexes. See To Recover Using Search on page 110.
-Using Search on page 110.+
Line 64: Line 63:
#Start the Recovery module to display the list of available backups. #Start the Recovery module to display the list of available backups.
-#Highlight the backup you want to recover from, and select Contents >+#Highlight the backup you want to recover from, and select Contents > Open to list the base directories in this media set.
-Open to list the base directories in this media set.+ 
-Figure 26 — Backups available for recovery+ Figure 26 — Backups available for recovery
'''Selecting what files to recover''' '''Selecting what files to recover'''
-#The next step is to choose the backup steps you want to recover files from.+ 
-#*To recover the whole backup, select all the base directories.+:The next step is to choose the backup steps you want to recover files from.
-#*To recover all the files from selected steps in the backup, select those directories.+:*To recover the whole backup, select all the base directories.
-#*To recover all or selected files from a single backup step, select that directory.+:*To recover all the files from selected steps in the backup, select those directories.
-#*To choose files from an online index, select one base directory only, then+:*To recover all or selected files from a single backup step, select that directory.
-select Index > Open, then select the files you want to recover.+:*To choose files from an online index, select one base directory only, then select Index > Open, then select the files you want to recover.
'''Specifying the recovery parameters and destination''' '''Specifying the recovery parameters and destination'''
-#Select Recover > Interactive if you want to monitor the output+#Select Recover > Interactive if you want to monitor the output from the recovery job. Select Recover > Background if you don’t want to monitor the progress of the recovery job. Figure 27 — List of base directories in the selected backup
-from the recovery job. Select Recover > Background if you don’t want+#If more than one logical drive can read this media set, backup3G lists them now. Choose one. If only one drive is valid for this media type, this step is skipped.
-to monitor the progress of the recovery job.+#Some user roles are restricted in where they can recover files. Backup3G lists the hosts and directories you are allowed to recover to. If you have no restrictions, this step is skipped. Figure 28 — Recover to which host and directory?
-Figure 27 — List of base directories in the selected backup+#A form similar to the one in Figure 29 now prompts you to supply any remaining details. The fields to be filled in depend on the type of recovery and your own access capabilities. Figure 29 — Recovery prompt form (example)
-#If more than one logical drive can read this media set, backup3G lists them+#;Recover to host: Select the name of the host to which the files should be recovered. The default is the original host.
-now. Choose one. If only one drive is valid for this media type, this step is+#;:If you chose a host in step 6 on page 107, this field will be filled in for you.
-skipped.+#;Into directory: Specify where the recovered files should go. The target directory will be created if it doesn’t already exist.
-#Some user roles are restricted in where they can recover files. backup3G lists+#;:For an image backup, enter the full filename.
-the hosts and directories you are allowed to recover to. If you have no+#;:If you want to compare the current files on disk with the backedup versions, recover to a temporary directory so that the current versions will not be overwritten.
-restrictions, this step is skipped.+#;:If you chose a target directory in step 6 on page 107, this field will be filled in for you.
-Figure 28 — Recover to which host and directory?+#;Auto unload: Select ‘yes’ to unload the backup volume from the drive after the recovery has finished.
-#A form similar to the one in Figure 29 now prompts you to supply any+#;:This field only appears for a background recovery.
-remaining details. The fields to be filled in depend on the type of recovery+#;Recovery method: Select the recovery method. The default should be correct, as the recovery method is determined by the original backup method and format.
-and your own access capabilities.+#Press Accept.
-Figure 29 — Recovery prompt form (example)+ 
-Recover to host+ 
-Select the name of the host to which the files should be recovered.+Backup3G queues the job and requests the first volume containing files to be recovered.
-The default is the original host.+ 
-If you chose a host in step 6 on page 107, this field will be filled in+ 
-for you.+----
-Into directory Specify where the recovered files should go. The target directory+;Caution: Recovery overwrites any existing files with backup files of the same name. Before you recover files, make sure that you won’t lose important data.
-will be created if it doesn’t already exist.+----
-For an image backup, enter the full filename.+
-If you want to compare the current files on disk with the backedup+
-versions, recover to a temporary directory so that the current+
-versions will not be overwritten.+
-If you chose a target directory in step 6 on page 107, this field will+
-be filled in for you.+
-'''Caution -''' Recovery overwrites any existing files with backup files of the same name. Before 
-you recover files, make sure that you won’t lose important data. 
-Auto unload Select ‘yes’ to unload the backup volume from the drive after the 
-recovery has finished. 
-This field only appears for a background recovery. 
-Recovery method 
-Select the recovery method. The default should be correct, as the 
-recovery method is determined by the original backup method and 
-format. 
-#Press Accept. backup3G queues the job and requests the first volume containing 
-files to be recovered. 
'''Selecting files from a single backup step''' '''Selecting files from a single backup step'''
-If you selected a single base directory in step 3 on page 107, you can choose which+#If you selected a single base directory in step 3 on page 107, you can choose which files and directories you want to recover.
-files and directories you want to recover.+#;Type: To recover all files in the backup step, select ‘full’; to choose which files and directories to recover, use recovery type ‘selected’.
-Type To recover all files in the backup step, select ‘full’; to choose which+#;Pick from index?: If you wish to select files from the online index, set this field to ‘yes’ and press Accept. Select the files and directories and press Accept again to queue the recovery job.
-files and directories to recover, use recovery type ‘selected’.+#:If you don’t wish to select files from the index (or if there is no index) you will need to list the files and directories to be recovered.
-Pick from index?+#;Files to recover: Enter a space-separated list of files (not directories). The file names should be relative to the base directory.
 +#;Sub-directories: Enter a space-separated list of directories (not files). The directory names should be relative to the base directory.
 +#:Example: the base directory is <tt>/usr</tt>. To recover <tt>/usr/file.one</tt>, <tt>/usr/tmp/file.two</tt>, and all the files in <tt>/usr/lib/term</tt>, enter:
 +#Press Accept
-If you wish to select files from the online index, set this field to 
-‘yes’ and press Accept. Select the files and directories and press 
-Accept again to queue the recovery job. 
-If you don’t wish to select files from the index (or if there is no index) you will need+Backup3G queues the job and requests the first volume containing files to be recovered.
-to list the files and directories to be recovered.+
-Files to recover+
-Enter a space-separated list of files (not directories). The file+
-names should be relative to the base directory.+
-Sub-directories+
-Enter a space-separated list of directories (not files). The directory+
-names should be relative to the base directory.+
-Example: the base directory is /usr. To recover /usr/file.one, 
-/usr/tmp/file.two, and all the files in /usr/lib/term, enter: 
-#Press Accept when you are finished. backup3G queues the job and 
-requests the first volume containing files to be recovered. 
You can use the Monitor option to see what stage the recovery job is at. You can use the Monitor option to see what stage the recovery job is at.
<br> <br>
 +
=== To Recover Using Search === === To Recover Using Search ===

Revision as of 10:56, 20 April 2006

This section explains how to recover files from backup. You recover data by telling backup3G:

If backup3G is unavailable you will need to restore it manually from a recent backup. See To Recover backup3G Manually on page 113.


Contents

Recovery Options

Files can be restored to the original host machine or to any other host on the network (though some users may have restrictions on which directories they can recover to—see Restricting Recovery Destinations by Role on page 51).

You can specify a different target directory from the original. If the directory doesn’t already exist backup3G will create it. If you are recovering selected files under a directory, backup3G will also restore any subdirectories it needs to recreate each file’s directory path.

In summary, the options available for restoration are:


Furthermore, if you are recovering from several discrete steps, you can recover to the same host and all steps will relate to the specified directory. For example, If you are recovering /etc/passwd and /usr/bin/go to the directory /tmp on host mama, the recovered files will be in /tmp/etc/passwd and /tmp/usr/bin/go.



Note
The restored file will be created with its original ownership and permissions. Any intermediate directories will be owned by root.


Recovering From Indexes

Backup3G keeps online indexes of backed up files. You can search the indexes for a file or directory. If necessary an index can be deleted to save disk space.


Single-Volume Backups

For a simple single-volume backup, each tape file corresponds to a backup step that backs up a base directory and all its subdirectories. Multi-part backups are written out in several parts, each part corresponding to a physical tape file.


Multi-part Backups

When you recover from a multi-part backup backup3G asks you to choose the base directory, then specify whether you want to do a full recovery or recover only selected files. For a selected recovery you can list the files and directories to be recovered or pick files from the online index (if one was created). For indexed backups backup3G reads only the parts containing files to be recovered.


How To Recover Files From Backup

The Recovery module provides options to recover all of the contents of a media set or to recover only selected parts.


To Recover Files From a Known Backup

This topic describes how to do a recovery when you know which media set contains the files.

If you don’t know which backup contains the correct versions of the files, you will first need to search the media contents database or online indexes. See To Recover Using Search on page 110.


Selecting the backup

  1. Start the Recovery module to display the list of available backups.
  2. Highlight the backup you want to recover from, and select Contents > Open to list the base directories in this media set.
Figure 26 — Backups available for recovery


Selecting what files to recover

The next step is to choose the backup steps you want to recover files from.
  • To recover the whole backup, select all the base directories.
  • To recover all the files from selected steps in the backup, select those directories.
  • To recover all or selected files from a single backup step, select that directory.
  • To choose files from an online index, select one base directory only, then select Index > Open, then select the files you want to recover.


Specifying the recovery parameters and destination

  1. Select Recover > Interactive if you want to monitor the output from the recovery job. Select Recover > Background if you don’t want to monitor the progress of the recovery job. Figure 27 — List of base directories in the selected backup
  2. If more than one logical drive can read this media set, backup3G lists them now. Choose one. If only one drive is valid for this media type, this step is skipped.
  3. Some user roles are restricted in where they can recover files. Backup3G lists the hosts and directories you are allowed to recover to. If you have no restrictions, this step is skipped. Figure 28 — Recover to which host and directory?
  4. A form similar to the one in Figure 29 now prompts you to supply any remaining details. The fields to be filled in depend on the type of recovery and your own access capabilities. Figure 29 — Recovery prompt form (example)
    Recover to host
    Select the name of the host to which the files should be recovered. The default is the original host.
    If you chose a host in step 6 on page 107, this field will be filled in for you.
    Into directory
    Specify where the recovered files should go. The target directory will be created if it doesn’t already exist.
    For an image backup, enter the full filename.
    If you want to compare the current files on disk with the backedup versions, recover to a temporary directory so that the current versions will not be overwritten.
    If you chose a target directory in step 6 on page 107, this field will be filled in for you.
    Auto unload
    Select ‘yes’ to unload the backup volume from the drive after the recovery has finished.
    This field only appears for a background recovery.
    Recovery method
    Select the recovery method. The default should be correct, as the recovery method is determined by the original backup method and format.
  5. Press Accept.


Backup3G queues the job and requests the first volume containing files to be recovered.



Caution
Recovery overwrites any existing files with backup files of the same name. Before you recover files, make sure that you won’t lose important data.


Selecting files from a single backup step

  1. If you selected a single base directory in step 3 on page 107, you can choose which files and directories you want to recover.
    Type
    To recover all files in the backup step, select ‘full’; to choose which files and directories to recover, use recovery type ‘selected’.
    Pick from index?
    If you wish to select files from the online index, set this field to ‘yes’ and press Accept. Select the files and directories and press Accept again to queue the recovery job.
    If you don’t wish to select files from the index (or if there is no index) you will need to list the files and directories to be recovered.
    Files to recover
    Enter a space-separated list of files (not directories). The file names should be relative to the base directory.
    Sub-directories
    Enter a space-separated list of directories (not files). The directory names should be relative to the base directory.
    Example: the base directory is /usr. To recover /usr/file.one, /usr/tmp/file.two, and all the files in /usr/lib/term, enter:
  2. Press Accept


Backup3G queues the job and requests the first volume containing files to be recovered.

You can use the Monitor option to see what stage the recovery job is at.


To Recover Using Search

The Search option on the main Recover window illustrated in Figure 26 allows you to search for data to recover using the base directory for the backup or using the filename from online indexes. If you don’t know which backup contains the files you want to recover, this will give you list of all backup copies of the files you specify. Recovering Data 111


To search for base directories

  1. Start the Recovery module to display the list of available backups.
  2. Select Search > Base directories.

The search options are described in detail in Searching Backup Media on page 46 and in How To Read Backup Media Contents on page 127.



How to Recover backup3G

Manual restoration is quite simple once you have the tape containing the files you need to recover from and a media catalog that lists its contents. The media catalog is printed at the end of each backup job.

Backups in cpio, dump, or tar format can be recovered from the command line. Once you know what backup method was used, Table 6 tells you the command to use for the recovery.


Overview

You will need:

name (example: /dev/nrmt0h).

block size of the tape, and the file number, base directory, and format of each backup file on each tape. If the media database is lost you should be able to get this from the set of hardcopy media catalogs produced by each backup job. Figure 30 shows a sample. If these printouts have been destroyed or were not kept your only other option is to start scanning tapes using dd.

The standard procedure for restoring data without COSmanager is to recover COSmanager and backup3G first, then use backup3G to recover the required data. Your backups should have been configured so that COSmanager and backup3G are in the last tape file in the media set (see Designing Backup Procedures to Aid Data Recovery on page 21).


To Recover backup3G Manually

  1. Log in as root to the host with the tape drive attached.
  2. Change to the directory where you want to restore backup3G. This would

usually be the original base directory. Example: cd /usr/COSmanager

  1. The media catalog lists the tapes in the media set and shows what files are

on each tape. Using this, find the tape and the number of the tape file containing your data, then load the tape. Note that file 1, the first file on the tape, is the electronic label.

  1. Skip to the beginning of the selected tape file. The tape will be positioned at

file 1, so to get to file N you must skip forward N-1 files. On most UNIX systems the command is: mt -f <no-rewind device> fsf <N-1> Example: to skip to file 5, enter: mt -f <no-rewind device> fsf 4

  1. The media catalog shows the block size of the tape and the backup format

for each file.

Note - The media catalog shows the block size in kilobytes, but dd expects the ibs parameter to be in bytes. Either multiply the block size by 1024 to convert it to bytes, or add k to the end to specify the block size in kilobytes. Example: if the media catalog reports a block size of 20, specify either: ibs=20k or ibs=20480. For HP/UX try: mt -t <no-rewind device> fsf 4 For SCO UNIX try: tape rfm 4 <no-rewind device>

  1. Enter the command to perform a full recovery of the tape file:

Table 6 — Commands to manually recover each backup format

When backup3G is successfully restored you can use it to recover any other data from backup.


Layout of the Media Catalog

Figure 30 — Sample media catalog produced by medprint Format UNIX Version Command cpio All dd if=<no-rewind device> ibs=<bs> | cpio -icdumB zcpio All dd if=<no-rewind device> ibs=<bs> | uncompress | cpio -icdumB tar All dd if=<no-rewind device> ibs=<bs> | tar xpf - dump SVR4 dd if=<no-rewind device> ibs=<bs> | ufsrestore xf - dump SVR3 or BSD dd if=<no-rewind device> ibs=<bs> | restore xf - Media Media type Tape file Block size (kilobytes) Backup method (incl. format) Base directory number number