Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

backup (savevg) vgdata on a remote tape ?

Status
Not open for further replies.

oliverbeat

Technical User
Sep 3, 2004
86
NZ
Hi,

I would like if it is possible to make a savevg (vgdata have only one filesystem 35Gb) on a remote tape.
I have a lpar on a p570 and a tape drive attached to another p570.
Do you think I can do a remote savevg (via nfs I don't know...) or if you have another idea ...
Thanks in advance.
 
A quick google found.

Code:
# Make named pipe
mknode /tmp/pipe p

# Output pipe to remote node
cat /tmp/pipe | rsh remotemachine "dd of=/dev/rmt0.1 bs=1024 copy=sync
" &

# Start Backup
/usr/bin/savevg -i -e datavg -f /tmp/pipe

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Thanks I will try this tomorrow. Let you know

Cheers
 
One thing though: it's "mknod", not "mknode"


HTH,

p5wizard
 
damm you cut & paste........ Thanks p5

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Good script Mike

Just another thought, If its only one filesystem then why don't you just backup this filesystem only:

Code:
rsh remotemachine 'cd /filesystem_bkup; find . -print | backup -iq -b0 -f -' | dd of=/dev/rmt0 bs=0b

Regards,
Khalid
 
Hi guys,

Thanks a lot.
So here what I did and it works fine!
rm -f /tmp/pipe
mknod /tmp/pipe p
cat /tmp/pipe | ssh <remotename> "dd of=/dev/rmt0 bs=1024 conv=sync" &
/usr/bin/savevg -i -f /tmp/pipe vgname

I have check the tape containing my savevg and try a restore on a spare machine that have the tape drive attached and it works...

But now I have to do the restore remotely using restvg but I have an issue with the command... could you help please...
 
You might want to define your pipe's name based on PID, to prevent collisions if your technique is reused in another script.

To restvg, you need to reverse the dd and redirect its output to the pipe.

Code:
TMPPIPE="/tmp/pipe$$"
rm -f $TMPPIPE
mknod $TMPPIPE p
ssh <remotename> "dd [COLOR=red]i[/color]f=/dev/rmt0 bs=1024 conv=sync" > $TMPPIPE &
/usr/bin/restvg -f $TMPPIPE vgname

- Rod




IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

A Simple Code for Posting on the Web
 
Hi,

I tried again but It still doesn't work.
I have the following error:
0512-054 restvg: File /tmp/pipe192718 does not exist or is empty.
I did exactly as below (proposed by Rod).

Any idea ?
Cheers
 
Looks like you'll need a delay between the ssh background launch and the restvg, since restvg apparently takes a look at the file size before proceeding. Try a "sleep 30", or even "sleep 60". Presumably the restvg will take a while, so there's no harm in waiting a minute for some data to buffer.

You might also want to try some sort of double bufferring to ensure that the restvg doesn't run into a premature EOF on the pipe.

Another option would be to make your own version of restvg that works better with the pipe. restvg is just a shell script (albeit a fairly complex one), so you can copy and modify it if you're comfortable doing that sort of thing.

- Rod


IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

A Simple Code for Posting on the Web
 
Just thought of a reason that a customized restvg would be the only way to do this.

I don't have access right now to an AIX box to check, but I seem to recall that restvg actually reads the file or tape twice, once to restore just the vgdata files so it can construct the volume group and logical volumes, then again to restore the actual files.

If I'm right about this, then you'll need to insert your pipe/ssh/dd/sleep combo code directly into restvg at the appropriate places to fake it out.

- Rod



IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

A Simple Code for Posting on the Web
 
I tried several things but still not working... thanks for help
I am continuing to try as I need it to be restored...
Let me know if you have other ideas...

Cheers
 
Hi Guys
well well well I have enough to try so what I did I have use my savevg tape and restore to a spare machine attached to a tape and then restore the filesystem remotely using tar command....
I didn't want to use tar because I never if everything was restored fine and with the good access, permission ..

here the command I run from my spare machine (where I restore the data using the tape savevg) to the one who needs the data....
cd /fsdata
tar cvfhl - * | (ssh hostname "cd /fsdata ; tar xvfp -")

Do you have an idea how to check quickly that is done correctly
The data base seems ok but... again it is my problem with tar...
I know I am stressful! :)
Cheers
Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top