Operating System - HP-UX
1854930 Members
3509 Online
104106 Solutions
New Discussion

Re: Restoring from TAR... directory problems

 
SOLVED
Go to solution
Shane Travis
Frequent Advisor

Restoring from TAR... directory problems


Alright, I'm back again with my 'tales of woe'. Still maintaining HP-UX 8.0 systems, and they're starting to get old. Recently had a(nother) disk fail, boot-drive, and am in the process of trying to recover from backups.

No, they're not paper tapes. :-)

They aren't much better, though; the whole root disk was put on a DAT using the command "tar -cvf /dev/rmt/0m /"

The bugger of that is this: I now have a replacement disk with a filesystem on it, and have connected it to another machine with a DAT drive in the hopes of recovering from the DAT onto the new HD... but when I try and get the stuff off the tape, it doesn't want to put it in on the shiny *new* disk. Oh no, it wants to overwrite the complete O/S on the machine it's hooked up to!

A 'tar -tvf' on the backup tape produces the following results:

rwxr-xr-x 0/0 0 Dec 7 15:33 1998 //
rw-rw-rw- 0/3 0 Aug 29 14:35 1992 //.x11startlog
rwxr-xr-x 0/1 1340935 May 17 14:37 1993 //hp-ux
rwxr-xr-x 0/0 0 Feb 7 14:57 1992 //lost+found/
rwxr-xr-x 0/0 0 Sep 6 00:39 1996 //dev/
rw--w--w- 202/20 0 Sep 6 00:49 1996 //dev/syscon
rw------- 0/3 0 Feb 11 15:32 1992 //dev/lan0
rwxr-xr-x 0/0 0 May 25 11:01 1993 //dev/dsk/
rw-rw-rw- 0/3 0 Nov 11 00:39 1992 //dev/dsk/0s0
rw-rw-rw- 0/3 0 Jul 21 11:03 1995 //dev/dsk/2s0
rw-rw-rw- 0/3 0 Jun 29 18:08 1993 //dev/dsk/6s0

[etc. etc. for a long way]

As you can see, the path in all cases is prefaced by //, so the un-tar is trying to put this stuff in the root directory.

Here's the question: is there any way to tell tar (especially this older version) *NOT* to try and overwrite /hp-ux and /dev and /etc and everything else, but to put all that output into _this_ directory?

Corollary: is there a way to set / to anything other than the root disk? If so, I could link that to the new disk, and I'd be fine. (I don't think so, but I'm working laterally here.)

Finally, when this is all done, I'd like to get newer, better backups. (These were all done for Y2K preparation. Still pretty much the same since then, mind, but doesn't hurt.) Given that I don't have fancy tools like Ignite on this old system (but neither do I have the hassles of lvols), what's peoples' suggestions about the best way to go about it?

Thanks for reading this far, and for any help you can give.
7 REPLIES 7
Martin Johnson
Honored Contributor

Re: Restoring from TAR... directory problems

I would boot from a maintenance CD and try to do a tape recovery. The problem is your tar backup has a fully qualified path, which is why it is trying to overwrite the boot disk on the new system.

HTH
Marty
James R. Ferguson
Acclaimed Contributor
Solution

Re: Restoring from TAR... directory problems

Hi Tim:

'pax' can be used to circumvent extracting a tar tape written with absolute paths. Try this:

# /sbin/pax -r -p e -s ',/,/newdir/,' -f /dev/rmt/0m

This will extract the root directory into /newdir preserving permissions and ownership.

I'm not sure if 'pax' existed for 8.0.

Regards!

...JRF...
Arockia Jegan
Trusted Contributor

Re: Restoring from TAR... directory problems

The GNU tar utility will help you to extract the tar file under the working directory eventhough you make the tar file by giving absolute path of the source files. The regular tar utility won't help you to do this.
Martin Johnson
Honored Contributor

Re: Restoring from TAR... directory problems

James,

I don't think pax was available for v8. (v8! Jeesh, I didn't think those things still existed - it's like finding a living dinosaur!)

:-)
Marty
Ceesjan van Hattum
Esteemed Contributor

Re: Restoring from TAR... directory problems

You might give a re-tar give a try:
tar -xvf [arch1] | tar cvf [arch2]
Then tar tvf [arch2] and see what you get..

Regards,
Ceesjan
Shane Travis
Frequent Advisor

Re: Restoring from TAR... directory problems

As always, excellent help, and quickly. Some individual responses:

==========
Martin - No CD for me. These were installed from DAT originally, and have no CDs attached. It might be possible to get one, but it'd be a _lot_ more work than I'd like to go through. (I forgot to mention that I'm doing this all remotely: computers are in Britain and I'm in Canada.)

==========
James - Pax, you say? Never heard of it. Hrm... lemme check.

acsesys romeo 23: which pax
/usr/bin/pax
acsesys romeo 24: uname -a
HP-UX romeo B.08.00 A 9000/380 080009181847

Yup, I've got it, even way back when on an 8.0 Martin. :-)

This certainly looks promising, at the very least; it seems like it could do what I want. Dissecting your command line, I can figure what the -p, -s and -f are for... what's the 'e', and why am I using only -r and not -rw?

(I tried running this command line, BTW, substituting "/acse/tmp/rnew/" for "/newdir/" just to see if it'd work, and slapping a -v on the end. After 30 minutes, still no output. Am I doing something wrong?)

Anyway, definitely worh investigating. Thanks for a new tool in my bag of tricks.

==========
Arockia - Excellent suggestion; I should have known that GNU would have more utility than the default. :-) URL, if you'd be so kind? I don't know if I can get one working on 8.0, but I do have a couple of 9.0 machines on that lan (with DAT drives), so perhaps I can can compile it there if there aren't any binaries to be found.

==========

Thanks again for the excellent and timely advice. Always great to come here when I'm out of ideas and be handed a few more.
Arockia Jegan
Trusted Contributor

Re: Restoring from TAR... directory problems

Here's the link for the GNU tar ,

ftp://ftp.gnu.org/gnu/tar/