Operating System - HP-UX
1832898 Members
2471 Online
110048 Solutions
New Discussion

Re: tar backup and restore

 
SOLVED
Go to solution
DeafFrog
Valued Contributor

tar backup and restore

Dear Guru,
i googled for the any such previous thread
but was not able to find.here is a senario :

/dev/vg01/lvol3 10485760 29012 9803266 0% /var/mqsi
/dev/vg01/lvol1 26214400 56299 24523276 0% /var/mqm
/dev/vg01/lvol2 20971520 3193062 16667359 16% /var/mqm/log

i am doing -x inc_entire=vg00 in the ignite .
1)with the ignite tape , can i restore /var/mqm/log
since /var is in vg00 , ie mount mounts have been transversed
while taking the ignite backyp.

2)OR , If i backup the like this :
#tar cvf /dev/rmt/0m $(cat ~myhome/test1)
where test1 is :
#more test1
/var/mqsi
/var/mqm
/var/mqm/log
/usr/local/utilities
/xyz
/xyz1
/Logs
(I.e backing up absolute path)

will i able to do a complete restore of say /xyz,
#pwd
/
#tar xvf /dev/rmt/0mn /xyz
Is the understanding correct.
FrogIsDeaf
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor

Re: tar backup and restore

Hi:

You can restore your directory from your Ignite tape:

# mt -f /dev/rmt/0mn fsf 1
# tar -xvf /dev/rmt/0m var/mqsi var/mqm

Ignite used relative paths (a wise way to make any 'tar' archive!)

Regards!

...JRF...
Michal Kapalka (mikap)
Honored Contributor

Re: tar backup and restore

hi,

the best solution is to extract it from ignite tape ( advice from JRF ), and if you are use the tar command you should extract if without /. The slash will be ignored.

when i migrated some data i mounted it with NFS and use find + cpio, to move it to other location.

mikap
DeafFrog
Valued Contributor

Re: tar backup and restore

Hello James,

Thanks for prompt response.Is the second method of taking backup with absolute path correct considering i will need to restore every time exactly at same location.

Regards ,
Rahul
FrogIsDeaf
V. Nyga
Honored Contributor

Re: tar backup and restore

Hi,

this means you'll do an ignite tape of your os (vg00) and a tar tape for additionl things (vg01).

So you restore your server by
1. ignite for os
2. add tape for the additional things

This will work
Volkmar
*** Say 'Thanks' with Kudos ***
OldSchool
Honored Contributor

Re: tar backup and restore

JRF said:

# mt -f /dev/rmt/0mn fsf 1
# tar -xvf /dev/rmt/0m var/mqsi var/mqm


Right, but the question was (and I have) is did Ignite catch the contents of those since they are in vg01, and only vg00 was included? or what Ignite does when building the list in this case.

I suppose a quick way to tell would be substitute "-tvf" for "-xvf" in the above.
DeafFrog
Valued Contributor

Re: tar backup and restore

Thanks Mikap and Volkmar,

Please let me know the correct method of restoration in second case i.e
tar cvf /dev/rmt/0m $(cat ~myhome/test1).
#pwd
/
#tar xvf /dev/rmt/0m var/mqm/log (if need to restore /var/mqm/log)
If need to restore a single file :
#tar xvf /dev/rmt/0m var/mqm/log/logfile1....Is that correct ..thanks a lot for all your help.
FrogIsDeaf
DeafFrog
Valued Contributor

Re: tar backup and restore

Dear Gurus,

I am done with day and will return after weekend.Thanks once again.
Regards,

Rahul
FrogIsDeaf
James R. Ferguson
Acclaimed Contributor
Solution

Re: tar backup and restore

Hi (again):

An easy way to answer your question is for you to perform a test. That said:

> Please let me know the correct method of restoration in second case i.e
tar cvf /dev/rmt/0m $(cat ~myhome/test1).

> tar xvf /dev/rmt/0m var/mqm/log

This will not work, given that you created you archive with an absolute path. You must specify that for 'tar' to find the directory (or file) in the archive. Thus, do:

# tar -xvf /dev/rmt/0m /var/mqm/log

> If need to restore a single file :
> tar xvf /dev/rmt/0m var/mqm/log/logfile1

The same applies; you need:

# tar -xvf /dev/rmt/0m /var/mqm/log/logfile1

Regards!

...JRF...

Dennis Handly
Acclaimed Contributor

Re: tar backup and restore

You may want to look into using pax(1) instead of tar. pax can read/write tar, cpio or pax extended.
DeafFrog
Valued Contributor

Re: tar backup and restore

If ignite is taken with -x inc_entire=vg00,the following can be restored, with ignite tape

/dev/vg01/lvol1 26214400 56299 24523276 0% /var/mqm, for the second case ,

i.s backup with absolute path , James is correct( as always !!)
FrogIsDeaf