1833762 Members
2501 Online
110063 Solutions
New Discussion

make_tape_recovery

 
SOLVED
Go to solution
Goran Kubelka
Advisor

make_tape_recovery

Dear All,

I have backup tape made by Make_tape_recovery command.
Is it possible to extract only one directory from this tape and restor it to original location.
4 REPLIES 4
Michael Tully
Honored Contributor
Solution

Re: make_tape_recovery

yes it is.

load the tape
# mt -t /dev/rmt/0mn fsf 1

e.g. to get the /home/fred directory (provided it is on the tape and assuming your tape drive is 0m)
# cd /
# tar xvf /dev/rmt/0mn home/fred

Anyone for a Mutiny ?

Re: make_tape_recovery

Hi,

you have to skip the LIF header with

mt -f /dev/rmt/0mn rew

mt -f /dev/rmt/0mn fsf 1

(use your own correct tape device file if different from /dev/rmt/0mn)

Then you can use tar to extract files/directories from the archive.

Regards,

Birgit
RAC_1
Honored Contributor

Re: make_tape_recovery

mt -f /dev/rmt/0mn fsf 1
tar -tvf /dev/rmt/0m > ./list

check list and file you want to restore.
again mt -f /dev/rmt/0mn fsf 1
cd /tmp

tar -xvf /dev/rmt/0mn you_file

move this file to original location after through check.

you may get error as end of tape reached.
There is no substitute to HARDWORK
Bernhard Mueller
Honored Contributor

Re: make_tape_recovery

Hello,

the only problem with standard HP-UX tar is that it extracts the directory ONLY e.g. a

tar xvf /dev/rmt/0m /home/myhome/scripts

would re-create an empty scripts dir but not the script files that are in it (and I bet that is what you really want).

So one (inefficient) way is to read the tarfile (tar tvf) and write the filelist to a file on disk which you use as a basis for a script that extracts all files.

The easy solution is to get GNU-tar, which allows you to extract a directory with everything in it from tarfile.

Regards,
Bernhard