Operating System - HP-UX
1753569 Members
5755 Online
108796 Solutions
New Discussion юеВ

Recove a file or directory from pax format make_tape_recovery archive

 
SOLVED
Go to solution
Raymond E. Lilly
Frequent Advisor

Recove a file or directory from pax format make_tape_recovery archive

Hi, I just began to use -m pax with make_tape_recovery to include files > 8Gb. What is the best way to restore a specific file or directory from an ignite tape made on an Intergity server where Pax type = pax, not tar?

With Pax type = tar I used this method:
mt -f /dev/rmt/0mn rew
mt -f /dev/rmt/0mn fsf 22
tar xvf /dev/rmt/0mn filename

Thanks,
Ray
10 REPLIES 10
Pete Randall
Outstanding Contributor

Re: Recove a file or directory from pax format make_tape_recovery archive

Same procedure, just substitute pax syntax in place of "tar xvf /dev/rmt/0mn filename".


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Recove a file or directory from pax format make_tape_recovery archive

Hi Ray:

You still need to skip the LIF on the tape. Then, using relative paths:

# pax -v -r -x pax -f /dev/rmt/0mn ./somefile

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: Recove a file or directory from pax format make_tape_recovery archive

Shalom,

http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1274661906327+28353475&threadId=831209

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor
Solution

Re: Recove a file or directory from pax format make_tape_recovery archive

Hi (again) Ray:

A check of the manpages (always a good thing) shows that the '-x ' argument isn't necessary (though syntactically ignored) when a 'pax' archive is read/recovered. Hence, if you archive was created in 'pax' format, doing:

# # pax -v -r -f /dev/rmt/0mn ./somefile

...would show:

USTAR format archive extended
./somefile

...where "extended" indicates a 'pax' format as opposed to the default 'tar' format which simply says "USTAR format archive".

Regards!

...JRF...
Raymond E. Lilly
Frequent Advisor

Re: Recove a file or directory from pax format make_tape_recovery archive

Hi James, It takes forever to run a test so I'd like be sure I've got this straight first. Please correct me where I'm wrong. (I like to see the -x pax so I left it in).

To skip the LIF, I always need these two lines:
mt -f /dev/rmt/0mn rew
mt -f /dev/rmt/0mn fsf 22

To restore /etc/hosts as an example, what would be the proper syntax to restore it the original location?

pax -v -r -x pax -f /dev/rmt/0mn etc/hosts

Then to an alternate location / name?
pax -v -r -x pax -f /dev/rmt/0mn -s,etc/hosts,tmp/hosts.xyz

Is the -v required in either of these examples?

PS - I read the man pages and then decided a post on the forums was in order ;-)
Dennis Handly
Acclaimed Contributor

Re: Recove a file or directory from pax format make_tape_recovery archive

>It takes forever to run a test

Try a small file near the start first.

>what would be the proper syntax to restore it the original location?
>pax -v -r -x pax -f /dev/rmt/0mn etc/hosts

You would need to be in /.

>Then to an alternate location / name?
>pax -v -r -x pax -f /dev/rmt/0mn -s,etc/hosts,tmp/hosts.xyz

I would typically never rename the file, just its path. This is something you should try by creating a small pax archive and extract it. Also add -k to prevent overwrite. I was trying to extract to a different directory recently and messed up the -s option and destroyed the originals.

>Is the -v required in either of these examples?

No, that's for verbose output. Good to use while testing or only one file.
James R. Ferguson
Acclaimed Contributor

Re: Recove a file or directory from pax format make_tape_recovery archive

Hi (again) Ray:

> Hi James, It takes forever to run a test

Then create a 'pax' archive in a directory of your choice and play with that:

# cd /tmp; pax -v -w -x pax -f /var/tmp/tmpstuff

# cd /var/tmp && pax -v -r -f /tmp/tmpstuff ./filename

Regards!

...JRF...
Raymond E. Lilly
Frequent Advisor

Re: Recove a file or directory from pax format make_tape_recovery archive

Thanks for all the tips - flattened the learning curve quite a bit.

The plan is to convert all my make_tape_recovery and make_net_recovery operations to -m pax format over time.

Aside from physical labeling, is there a reliable way to determine the Pax type used to create make_tape_recovery archives? Something similar to frecover -V perhaps?

Also, is there a graceful way to stop pax from reading to the end of a tape once it has recovered the files? These LTO-4's go on forever!
James R. Ferguson
Acclaimed Contributor

Re: Recove a file or directory from pax format make_tape_recovery archive

Hi (again) Ray:

> Aside from physical labeling, is there a reliable way to determine the Pax type used to create make_tape_recovery archives?

This is a bit crude, but you can list the archive (and then kill the process after the first few lines are output):

# pax -v -L -f /dev/rmt/0mn

If you see: "USTAR format archive extended" then you know that this is a 'pax' archive. If you see "USTAR format archive" *without* the string "extended", then you know that the 'pax' archive used a 'tar' format.

Regards!

...JRF...

"