cancel
Showing results for 
Search instead for 
Did you mean: 

Restore from a Partial Backup?

Mathew_Burke
Level 4

We need to restore some files off a LTO1 tape that had only a partial backup.  That is it looks like the backup ran, backed up 85GB of data then failed for some unknown reason (maybe network blip?).  A normal backup for the system was 90GB.  So someone expired the tape and tried to re-import it, but the import failed (because we never did have a full backup of the entire system).  So I can see that in the 2nd phase of the import, the files I want are there.  But since the import always fails (because there was never a 100% successful backup in the first place), I can't use the NetBackup restore program. I was thinking there must be some kind of TAR File left on the tape, but how do I get at it? Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions

J_H_Is_gone
Level 6

never did this to a netbackup tape but pulling from my unix history ( did this a long time ago) you can try this

 

tctl -f/dev/rmt0 rewind  ( to make sure tape is rewound to begining)

tctl -f/dev/rmt0.1 fsf # (use the .1 so it does not rewind when command is done) (fsf # is fast forward to a tape marker ( a bof).... if I was doing a mksysb tape it would be fsf 3 ... try 1, and 1 more .....)

now try to do a tar -tvf and see if you can read anything?

 

again not sure if this works on a netbackup tape, but this is what I would to do a unix tape that had more then one backup on it.

View solution in original post

5 REPLIES 5

J_H_Is_gone
Level 6

never did this to a netbackup tape but pulling from my unix history ( did this a long time ago) you can try this

 

tctl -f/dev/rmt0 rewind  ( to make sure tape is rewound to begining)

tctl -f/dev/rmt0.1 fsf # (use the .1 so it does not rewind when command is done) (fsf # is fast forward to a tape marker ( a bof).... if I was doing a mksysb tape it would be fsf 3 ... try 1, and 1 more .....)

now try to do a tar -tvf and see if you can read anything?

 

again not sure if this works on a netbackup tape, but this is what I would to do a unix tape that had more then one backup on it.

Mathew_Burke
Level 4

I am sure that will work, but I don't have a UNIX machine with a LTO tape drive.  Maybe if I setup a LINUX Media server.  I am fairly certain that Veritas Writes TAR files like you are saying.

 

Omar_Villa
Level 6
Employee

you can dump the full tape with tar command, then you can search for what are looking for.

Ron_Cohn
Level 6

Omar,

 

From a Windows perspective, how would you dump the tape so you can access the TAR file from disk?

Message Edited by Ron Cohn on 08-21-2008 04:16 PM

Rakesh_Khandelw
Level 6

If it was a failed backup, you wouldn't see anything in your phase 2 import. There can be descripency on backup size reported by NetBackup and the actual size because of the fact that you have some default exclude files.

 

Anyway, you know it better whether it was a failed or successful backup.

 

Here is how you can use tar -

 

 Reading backup images with tar
NetBackup for UNIX uses a modified GNU tar for reading backup images. The modified tar is located in /usr/openv/netbackup/bin/tar. By using the modified tar, NetBackup can understand compressed files, sparse files, long pathnames, ACL information. It offers features similar to those in cpio.
Although non-NetBackup versions of tar can be used to restore files, they provide only limited restore capabilities.
Note: You cannot use the NetBackup modified-GNU tar on UNIX or tar32.exe on Windows to extract files from a NetBackup for Windows backup image.
Effects of a non-NetBackup tar
Non-NetBackup versions of tar do not supply all of the restore capabilities that the NetBackup /usr/openv/netbackup/bin/tar provides. Possible problems result.
The following is a list of some effects that a non-NetBackup tar may encounter in certain situations:

Compressed backups cannot be recovered.

Multiplexed backups cannot be recovered.

Solaris extended attributes cannot be restored to a client.

VxFS named data streams cannot be restored to a client.

Backups cannot be recovered that contain raw partitions. (Includes FlashBackup images.)

NDMP client backup images cannot be restored, though NDMP vendors may have tools or the utilities that may perform a restore directly from the media.

Non-NetBackup versions of tarmay have trouble with sparse files and often skip sparse files.

HP CDFs are restored with non-NetBackup versions of tar. The directory is no longer hidden and the name of the directory has a + appended to it.

If the backup spans more than one piece of media, you must read and combine the fragments from the media to give to tar. To combine the fragments, the system’s dd command may be useful. Another possibility is to use taron the fragments. To use taron fragments may allow recovery of any file in the backup other than the one that spanned the media.

Some versions of the HP9000-800 /bin/tar command are known to give a directory checksum error for the second fragment of a backup that crossed media.
■ Some versions of Solaris tar combine the atime,mtime, and ctime strings with the file name and create the file paths that are not desirable.

 


To restore files with a non-NetBackup tar


The following process explains how to use a non-NetBackup tarto read a
backup from a NetBackup tape. Most versions of tar can read the tapes that
NetBackup creates after using the mtcommand to position to the proper tape
location. First, see the notes following the procedure as well as “Effects of a
non-NetBackup tar” on page 162 for possible limitations.
This sequence assumes that the media is known to Media Manager and that the
tape drive is under Media Manager control.
First, obtain the following information:

The media id of the tape that contains the required backup.

The tape file number of the backup on the tape (see the NetBackup Images on Media report for this tape).

The tape type and density.

The tape pool.
To restore files with a non-NetBackup tar
1 tpreq -m media_id -a r -d density -p poolname -f /tmp/tape
Where:
media_id is the media id of tape that contains the backup.
density is the density of the tape.
poolname is the volume pool to which the tape belongs
2 mt -f /tmp/tape rew
3 mt -f /tmp/tape fsf file_#
Where:
file_# is the tape file number of the backup on tape. Determine the tape file
number by checking the NetBackup Images on Media report for the tape.
4 mt -f /tmp/tape fsr
5 /bin/tar -tvfb /tmp/tape blocksize
Where:
■ blocksize is 64 (assume that the tape is written with 32K blocks)

6 tpunmount /tmp/tape

 

 

Notes on the procedure, “To restore files with a non-NetBackup tar”

 

1 This procedure does not apply to optical platters.
2 This procedure does not apply to encrypted backups using NetBackup Encryption. Encrypted backups are recoverable, however, the backups cannot be decrypted. To determine if a backup is encrypted, run tar -t before the recovery. The output for an encrypted backup is similar to the following example:
erw-r--r-- root/other Nov 14 15:59 2006 .EnCryYpTiOn.388
-rw-r--r-- root/other Oct 30 11:14 2006 /etc/group.10-30
Where the e at the beginning of line one indicates that the backup is encrypted. (Additional messages appear during recovery.)
3 This procedure does not work on the Solaris platform. You cannot use /usr/sbin/tar on Solaris to read NetBackup backups. The Solaris tar command uses the ctime and the atime fields differently than other tar commands. When /usr/sbin/tar is used to restore backups, directories with large numbers are created at the top level. These directories are from the ctime and the atime fields being read as pathnames. You can, however, use /usr/openv/netbackup/bin/tar or GNU tarto read the backups on Solaris platforms.
4 Steps 1 and 6 are optional in a stand-alone environment. If step 1 is skipped, DOWN the drive, then substitute the /devpath of the drive in place of /tmp/tape in the other steps. Remember to UP the drive when you are done.
Example
The following example was successful on an HP9000-800 with a DOWNed 4mm stand-alone drive and the NetBackup tar. mt -t /dev/rmt/0hncb rew
mt -t /dev/rmt/0hncb fsf 1
mt -t /dev/rmt/0hncb fsr 1
/usr/openv/netbackup/bin/tar tvfb /dev/rmt/0hncb 64
Some platforms require other options on the tar command. The following is required on Solaris 2.4:
/usr/openv/netbackup/bin/tar -t -v -f /dev/rmt/0hncb -b 64

 

Files that tar generates
Any version of tar (including NetBackup-modified tar), can generate a number of files depending on the circumstances of the recovery:

@@MaNgLeD.nnnn For backups containing pathnames longer than 100 characters, tar generates the files that are named @@MaNgLeD.nnnn that contain the actual file.

@@MaNgLeD.nnnn_Rename targenerates another file (@@MaNgLeD.nnnn_Rename) that explains how to rename the @@MaNgLeD.nnnn files to return the files to the correct location.

@@MaNgLeD.nnnn_Symlink For long names of symbolic links, tar generates the files that are named @@MaNgLeD.nnnn_Symlink. These files contain descriptions of the symbolic links that need to be made to return a link to the correct file.

For cross-platform ACLs restores, tarcreates and stores the ACLs in .SeCuRiTy.nnnn files in the rootdirectory. Read or delete the files. Regenerate the ACLs to the corresponding files by hand. For more information, see “Restoring files and access control lists” on page 681.

For cross-platform VxFS extent attribute restores, tarcreates and stores extent attributes in .ExTeNt.nnnn files in the root directory. The files can either be deleted or read and the extent attributes regenerated by hand to the corresponding files.