Operating System - HP-UX
1755477 Members
3894 Online
108833 Solutions
New Discussion юеВ

What server does this tape belong to??

 
SOLVED
Go to solution
someone_4
Honored Contributor

What server does this tape belong to??

Hello everyone ..
I have a tape here with no label =(

How do I find out who it belongs to??
I did
# mt -t /dev/rmt/0mn fsf 1
# tar -tvf /dev/rmt/0m

and it has data on there .. but what host does it belong to and what date was it created ?

Thanks

~ Richard
8 REPLIES 8
Ian Dennison_1
Honored Contributor

Re: What server does this tape belong to??

If it has tar data on there (and the tar command gave you valid output), pull off 1 file that will uniquely identify where it came from.

If it is the OS, perhaps /etc/rc.config.d/netconf? That will provide the IP Address.

The Structure backed up should also identify what server it came from of it is a database backup (most databases include a unique identifier in their path name).

Share and Enjoy! Ian
Building a dumber user
someone_4
Honored Contributor

Re: What server does this tape belong to??

Yes ..
I thought about pulling one fill from there.

But is there a way to pull one file and redirect it to another directory?

Because I dont want to over write anything on the system.

~ Richard
Volker Borowski
Honored Contributor

Re: What server does this tape belong to??

Hi Richard,

if the tar-archive shows absolute pathnames, do not restore with tar, because you will overwrite, that is correct.

I remember a thread, where someone had a solution to read and redirect such an archive by using pax.
But I do not remember when that was.
A search for pax might be helpfull.

No points for this one.
(Because it is barely a solution :-)
Volker
Tony Contratto
Respected Contributor
Solution

Re: What server does this tape belong to??

Hi Richard,

To get the date the tape was created you can do the following:

# mt rew
# dd if=/dev/rmt/0m of=/tmp/tapelif bs=2048 count=10
# lifls -l /tmp/tapelif

the lifls command will show a number of lines like:
HPUX -12928 312 880 0 02/07/05 18:02:26

the date is in yy/mm/dd format so this tape was created on July 5th, 2002

--
Tony
got root?
S.K. Chan
Honored Contributor

Re: What server does this tape belong to??

Tar is not like fbackup that store header information. So it's going to be hard to determine where that tape comes from without restoring some files from it and check its content. Now the good stuff ..
Say you have a "absolute" tar archive and you want to restore all files in /etc/rc.config.d but put them in /tmp/dirA, thus not overwritting what's already in /etc/rc.config.d. This is what you would do.. I have tested this before and it works for me ..
# cd /tmp/dirA
# pax -r -s ',^/etc/rc.config.d/,,' -f /dev/rmt/0m -t
It's kindda like replacement string in the pax command. The above will put all files in /etc/rc.config.d (example: netconf, nfsconf, ...) in /tmp/dirA
James R. Ferguson
Acclaimed Contributor

Re: What server does this tape belong to??

Hi Richard:

If the tape was written with absolute paths, then use 'pax' to substitute a different directory to receive a file for inspection:

The substitution syntax is: '-s/old/new/' and any nonnull character can be used as a delimiter.

# pax -r -p e -s '/\/olddir\//\/newdir\//'g -f /dev/rmt/0m

Regards!

...JRF...
Dietmar Konermann
Honored Contributor

Re: What server does this tape belong to??

pax -rv -f /dev/rmt/0m -s '%^/%%' /etc/rc.config.d/netconf
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Wodisch
Honored Contributor

Re: What server does this tape belong to??

Hi Richard,

since you treat it like "make_tape_recovery" tape, the information you ask for is just within the block you skip over...

HTH,
Wodisch