Backup3G 3.2.6/User Guide/Recovering Data
This page was last modified 01:51, 9 August 2007.From Documentation
Revision as of 01:51, 9 August 2007 Daniels (Talk | contribs) ← Previous diff |
Current revision Daniels (Talk | contribs) |
Current revision
This section explains how to recover files from backup. You recover data by telling backup3G:
- which data object or base directory to restore
- from which media set to restore the data object—that is, from the latest backup or from an older version
- to which directory and host the files will be restored
- whether all or only some files and subdirectories are to be recovered.
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:
- Recover whole media set
- Recover from selected steps
- Recover from indexes
- Recover selected files identified by search
- Recover base directories.
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
- Start the Recovery module to display the list of available backups.
- 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
- 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
- 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.
- 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?
- 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.
- 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
- 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:
- 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.
To search for base directories
- Start the Recovery module to display the list of available backups.
- 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:
- a suitable host, operating system, and target filesystem.
- the tape(s) containing backup3G.
- a tape drive of the right format. You will need to know the no-rewind device name (example: /dev/nrmt0h).
- a listing of the contents of this media set, including the media type and 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
- Log in as root to the host with the tape drive attached.
- Change to the directory where you want to restore backup3G. This would usually be the original base directory. Example: cd /usr/cosmos
- 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.
- 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:
- For most UNIX try: mt -f <no-rewind device> fsf 4
- For HP/UX try: mt -t <no-rewind device> fsf 4
- For SCO UNIX try: tape rfm 4 <no-rewind device>
- The media catalog shows the block size of the tape and the backup format for each file.
- Enter the command to perform a full recovery of the tape file:
Table 6 — Commands to manually recover each backup format 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 -
- 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.
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