Backup3G/User Guide/Recovering Data
From Documentation
Revision as of 05:58, 18 April 2006 Daniels (Talk | contribs) ← Previous diff |
Revision as of 02:55, 19 April 2006 Moff (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
- | This chapter explains how to recover files from backup. | + | This section explains how to recover files from backup. You recover data by telling backup3G: |
- | You recover data by telling backup3G: | + | *which data object or base directory to restore |
- | • 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 |
- | • from which media set to restore the data object—that is, from the latest | + | *to which directory and host the files will be restored |
- | backup or from an older version | + | *whether all or only some files and subdirectories are to be recovered. |
- | • 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 | If backup3G is unavailable you will need to restore it manually from a recent | ||
- | backup. See To Recover COS/Backup Manually on page 113. | + | backup. See To Recover backup3G Manually on page 113. |
- | 104 Recovering Data | + | |
- | Recovery Options | + | <br> |
+ | == Recovery Options == | ||
+ | |||
Files can be restored to the original host machine or to any other host on the network | 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 | (though some users may have restrictions on which directories they can | ||
recover to—see Restricting Recovery Destinations by Role on page 51). | 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 | 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 | 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 | directory, backup3G will also restore any subdirectories it needs to recreate each | ||
file’s directory path. | file’s directory path. | ||
+ | |||
In summary, the options available for restoration are: | In summary, the options available for restoration are: | ||
• Recover whole media set | • Recover whole media set | ||
Line 23: | Line 26: | ||
• Recover selected files identified by search | • Recover selected files identified by search | ||
• Recover base directories. | • Recover base directories. | ||
+ | |||
Furthermore, if you are recovering from several discrete steps, you can recover to | 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 | the same host and all steps will relate to the specified directory. For example, If you | ||
Line 28: | Line 32: | ||
mama, the recovered files will be in /tmp/etc/passwd and | mama, the recovered files will be in /tmp/etc/passwd and | ||
/tmp/usr/bin/go. | /tmp/usr/bin/go. | ||
- | Note The restored file will be created with its original ownership and | + | |
+ | '''Note -''' The restored file will be created with its original ownership and | ||
permissions. Any intermediate directories will be owned by root. | 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 | + | <br> |
+ | === 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. | file or directory. If necessary an index can be deleted to save disk space. | ||
- | Recovering Data 105 | + | |
- | Single-Volume Backups | + | <br> |
+ | === Single-Volume Backups === | ||
+ | |||
For a simple single-volume backup, each tape file corresponds to a backup step that | 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 | 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. | out in several parts, each part corresponding to a physical tape file. | ||
- | Multi-part Backups | + | |
+ | <br> | ||
+ | === Multi-part Backups === | ||
+ | |||
When you recover from a multi-part backup backup3G asks you to choose the base | 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 | directory, then specify whether you want to do a full recovery or recover only | ||
Line 44: | Line 57: | ||
recovered or pick files from the online index (if one was created). For indexed backups | 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. | backup3G reads only the parts containing files to be recovered. | ||
- | 106 Recovering Data | + | |
- | How To Recover Files From Backup | + | <br> |
+ | == How To Recover Files From Backup == | ||
+ | |||
The Recovery module provides options to recover all of the contents of a media set | The Recovery module provides options to recover all of the contents of a media set | ||
or to recover only selected parts. | or to recover only selected parts. | ||
- | To Recover Files From a Known Backup | + | |
+ | <br> | ||
+ | === To Recover Files From a Known Backup === | ||
This topic describes how to do a recovery when you know which media set contains | This topic describes how to do a recovery when you know which media set contains | ||
the files. | the files. | ||
Line 54: | Line 71: | ||
first need to search the media contents database or online indexes. See To Recover | first need to search the media contents database or online indexes. See To Recover | ||
Using Search on page 110. | 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 > | + | '''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. | Open to list the base directories in this media set. | ||
Figure 26 — Backups available for recovery | Figure 26 — Backups available for recovery | ||
- | Recovering Data 107 | + | |
- | Selecting what files to recover | + | |
- | 3. The next step is to choose the backup steps you want to recover files from. | + | '''Selecting what files to recover''' |
- | • 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. |
+ | #*To choose files from an online index, select one base directory only, then | ||
select Index > Open, then select the files you want to recover. | select Index > Open, then select the files you want to recover. | ||
- | Specifying the recovery parameters and destination | + | |
- | 4. Select Recover > Interactive if you want to monitor the output | + | |
+ | '''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 | from the recovery job. Select Recover > Background if you don’t want | ||
to monitor the progress of the recovery job. | to monitor the progress of the recovery job. | ||
Figure 27 — List of base directories in the selected backup | Figure 27 — List of base directories in the selected backup | ||
- | 5. If more than one logical drive can read this media set, backup3G lists them | + | #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 | now. Choose one. If only one drive is valid for this media type, this step is | ||
skipped. | skipped. | ||
- | 6. Some user roles are restricted in where they can recover files. backup3G lists | + | #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 | the hosts and directories you are allowed to recover to. If you have no | ||
- | 108 Recovering Data | ||
restrictions, this step is skipped. | restrictions, this step is skipped. | ||
Figure 28 — Recover to which host and directory? | Figure 28 — Recover to which host and directory? | ||
- | 7. A form similar to the one in Figure 29 now prompts you to supply any | + | #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 | remaining details. The fields to be filled in depend on the type of recovery | ||
and your own access capabilities. | and your own access capabilities. | ||
Line 91: | Line 114: | ||
Into directory Specify where the recovered files should go. The target directory | Into directory Specify where the recovered files should go. The target directory | ||
will be created if it doesn’t already exist. | will be created if it doesn’t already exist. | ||
- | Recovering Data 109 | ||
For an image backup, enter the full filename. | For an image backup, enter the full filename. | ||
If you want to compare the current files on disk with the backedup | If you want to compare the current files on disk with the backedup | ||
Line 98: | Line 120: | ||
If you chose a target directory in step 6 on page 107, this field will | If you chose a target directory in step 6 on page 107, this field will | ||
be filled in for you. | be filled in for you. | ||
- | Caution Recovery overwrites any existing files with backup files of the same name. Before | + | |
+ | '''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. | 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 | Auto unload Select ‘yes’ to unload the backup volume from the drive after the | ||
Line 107: | Line 130: | ||
recovery method is determined by the original backup method and | recovery method is determined by the original backup method and | ||
format. | format. | ||
- | 8. Press Accept. backup3G queues the job and requests the first volume containing | + | #Press Accept. backup3G queues the job and requests the first volume containing |
files to be recovered. | 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. | ||
Line 115: | Line 141: | ||
files and directories to recover, use recovery type ‘selected’. | files and directories to recover, use recovery type ‘selected’. | ||
Pick from index? | Pick from index? | ||
+ | |||
If you wish to select files from the online index, set this field to | 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 | ‘yes’ and press Accept. Select the files and directories and press | ||
Accept again to queue the recovery job. | Accept again to queue the recovery job. | ||
- | 110 Recovering Data | + | |
If you don’t wish to select files from the index (or if there is no index) you will need | 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. | to list the files and directories to be recovered. | ||
Line 127: | Line 154: | ||
Enter a space-separated list of directories (not files). The directory | Enter a space-separated list of directories (not files). The directory | ||
names should be relative to the base directory. | names should be relative to the base directory. | ||
+ | |||
Example: the base directory is /usr. To recover /usr/file.one, | Example: the base directory is /usr. To recover /usr/file.one, | ||
/usr/tmp/file.two, and all the files in /usr/lib/term, enter: | /usr/tmp/file.two, and all the files in /usr/lib/term, enter: | ||
- | 9. Press Accept when you are finished. backup3G queues the job and | + | #Press Accept when you are finished. backup3G queues the job and |
requests the first volume containing files to be recovered. | 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. | ||
- | To Recover Using Search | + | |
+ | <br> | ||
+ | === To Recover Using Search === | ||
+ | |||
The Search option on the main Recover window illustrated in Figure 26 allows | 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 | you to search for data to recover using the base directory for the backup or using the | ||
Line 139: | Line 170: | ||
you list of all backup copies of the files you specify. | you list of all backup copies of the files you specify. | ||
Recovering Data 111 | 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. | + | '''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 | 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. | in How To Read Backup Media Contents on page 127. | ||
- | 112 Recovering Data | + | |
- | How to Recover backup3G | + | |
+ | <br> | ||
+ | == How to Recover backup3G === | ||
+ | |||
Manual restoration is quite simple once you have the tape containing the files you | 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 | need to recover from and a media catalog that lists its contents. The media catalog is |
Revision as of 02:55, 19 April 2006
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.
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
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 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.
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
- 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). Recovering Data 113 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 3. 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. 4. 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 5. 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> 114 Recovering Data 6. 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