Operating System - HP-UX
1834643 Members
2874 Online
110069 Solutions
New Discussion

Re: extract files from make_recovery tape ?

 
SOLVED
Go to solution
Jerry_109
Super Advisor

extract files from make_recovery tape ?

Hello HP,

I'm trying to view/extract certain files from my make_recovery tape. When I use the follwoing commands. The tape starts from stand, and not "home/j4s9389". Why ?

root@hohp40[/root]
# mt -t /dev/rmt/0m rew
root@hohp40[/root]
# mt -t /dev/rmt/0m rew
root@hohp40[/root]
# mt -t /dev/rmt/0m rew
root@hohp40[/root]
# mt -t /dev/rmt/0mn fsf 1
root@hohp40[/root]
# tar -tvf /dev/rmt/0m home/j4s9389/*
r-xr-xr-x 2/2 0 Nov 12 17:31 2005 stand/
rwxr-xr-x 0/0 0 Dec 9 14:11 2004 stand/lost+found/
rw-r--r-- 0/3 3752 Nov 12 17:28 2005 stand/ioconfig
rw-r--r-- 0/3 19 Dec 9 14:11 2004 stand/bootconf
r--r--r-- 0/3 1714 Apr 21 13:19 2005 stand/system
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor
Solution

Re: extract files from make_recovery tape ?

Hi Jerry:

It matters not where the files are on the tape. In fact, this is one of the problems with reading 'tar' archives -- 'tar' has to to serially search until it finds the file(s).

The order in which files were added to the archive when it was created determines the order that they will appear when reading the archive. This was controlled by the 'make_tape_recovery'.

Regards!

...JRF...
Jerry_109
Super Advisor

Re: extract files from make_recovery tape ?

so, If I use the xvf instead of the tvf it will only extract my home directory ?
James R. Ferguson
Acclaimed Contributor

Re: extract files from make_recovery tape ?

Hi Jerry:

Yes, to extract only your '/home' directory from the 'make_tape_recovery' archive, do:

# cd /
# mt -t /dev/rmt/0mn fsf 1
# tar -xvf /dev/rmt/0m ./home/j4s9389

Regards!

...JRF...
TwoProc
Honored Contributor

Re: extract files from make_recovery tape ?

You've got the right idea, use the "tvf" command to test what you're going to get with "xvf".

I think you're problem is that you didn't start off with "/home" when you used "home"

try again with "tvf" until you get what you're after.

tar tvf /dev/rmt/0m "/home/j4s9389/*"

Try the tvf command with and without the trailing "*" - if it's not quite what you want - as I think if you restore the directory by name, you'll also get all of the files below - but I can't remember for sure.

But, that's all a side-note - the real problem is that you've got to give a FULL path to the target if it is a FULL path backup(as opposed to relative, with a preceeding "." when the backup was created), which in the case of a recovery tape - it is a full pathed backup. I think that since you didn't start your target list at root "/", it wasn't giving you what you wanted.

We are the people our parents warned us about --Jimmy Buffett
Jerry_109
Super Advisor

Re: extract files from make_recovery tape ?

first try with "/home/j4s9389"

root@hohp40[/]
# mt -t /dev/rmt/0m rew
root@hohp40[/]
# mt -t /dev/rmt/0m rew
root@hohp40[/]
# mt -t /dev/rmt/0m rew
root@hohp40[/]
# mt -t /dev/rmt/0mn fsf 1
root@hohp40[/]
# tar -tvf /dev/rmt/0m /home/j4s9389
r-xr-xr-x 2/2 0 Nov 12 17:31 2005 stand/
rwxr-xr-x 0/0 0 Dec 9 14:11 2004 stand/lost+found/
rw-r--r-- 0/3 3752 Nov 12 17:28 2005 stand/ioconfig
rw-r--r-- 0/3 19 Dec 9 14:11 2004 stand/bootconf
r--r--r-- 0/3 1714 Apr 21 13:19 2005 stand/system
rwxr-xr-x 0/3 0 Nov 12 17:31 2005 stand/krs/
rw------- 0/0 67304 Nov 12 17:31 2005 stand/krs/_stand_vmunix.krs

################################
2nd try with "./home/j4s9389"

# mt -t /dev/rmt/0m rew
root@hohp40[/]
# mt -t /dev/rmt/0m rew
root@hohp40[/]
# mt -t /dev/rmt/0mn fsf 1
root@hohp40[/]
# tar -tvf /dev/rmt/0m ./home/j4s9389
r-xr-xr-x 2/2 0 Nov 12 17:31 2005 stand/
rwxr-xr-x 0/0 0 Dec 9 14:11 2004 stand/lost+found/
rw-r--r-- 0/3 3752 Nov 12 17:28 2005 stand/ioconfig
rw-r--r-- 0/3 19 Dec 9 14:11 2004 stand/bootconf
r--r--r-- 0/3 1714 Apr 21 13:19 2005 stand/system
Patrick Wallek
Honored Contributor

Re: extract files from make_recovery tape ?

I don't think the '-t' option to tar accepts file name arguments. I believe the '-t' will just list the entire contents of the tape.

When you do the '-x' you will get just your home directory. And with Ignite make_tape_recovery tapes, you do NOT want a leading '/' in the directory name. Ignite store the files with a relative path starting from the / directory.

Jerry_109
Super Advisor

Re: extract files from make_recovery tape ?

trying now :
root@hohp40[/]
# mt -t /dev/rmt/0m rew
root@hohp40[/]
# mt -t /dev/rmt/0m rew
root@hohp40[/]
# mt -t /dev/rmt/0m rew
root@hohp40[/]
# mt -t /dev/rmt/0mn fsf 1
root@hohp40[/]
# tar -xvf /dev/rmt/0m home/j4s9389
Jerry_109
Super Advisor

Re: extract files from make_recovery tape ?

Looks like it's working so far :
root@hohp40[/]
# mt -t /dev/rmt/0m rew
root@hohp40[/]
# mt -t /dev/rmt/0m rew
root@hohp40[/]
# mt -t /dev/rmt/0m rew
root@hohp40[/]
# mt -t /dev/rmt/0mn fsf 1
root@hohp40[/]
# tar -xvf /dev/rmt/0m home/j4s9389
x home/j4s9389/.profile, 470 bytes, 1 tape blocks
x home/j4s9389/.sh_history, 102 bytes, 1 tape blocks

#################################
root@hohp40[/home]
# ll
total 0
drwxr-xr-x 2 hpsmh hpsmh 96 Nov 16 12:51 hpsmh
drwx------ 2 18873 users 96 Nov 17 08:19 j4s9389
drwxr-xr-x 2 root root 96 Nov 16 11:32 lost+found
root@hohp40[/home]
# ls -la j4s9389
total 32
drwx------ 2 18873 users 96 Nov 17 08:19 .
drwxr-xr-x 5 root root 96 Nov 17 08:19 ..
-r--r--r-- 1 18873 users 470 Dec 10 2004 .profile
-rw------- 1 18873 users 102 Nov 4 09:08 .sh_history

SGUX
Valued Contributor

Re: extract files from make_recovery tape ?

when trying to restore a file/directory from a make_recovery_tape remember to leave the "leading /" in the tar-command, so the command:

tar -xvf /dev/rmt/0m home/j4s9389

had to be right.
Jeffrey L. Cooke
Occasional Advisor

Re: extract files from make_recovery tape ?

I like pax best to list:
# mt -f /dev/rmt/0m rew
# mt -f /dev/rmt/0mn fsf
# pax -vf /dev/rmt/0m home/j4s9389

and to extract:
# mt -f /dev/rmt/0m rew
# mt -f /dev/rmt/0mn fsf
# pax -r -pe -vf /dev/rmt/0m home/j4s9389

bonus ... eject the tape (for scripting):
# mt -f /dev/rmt/0m offl