Operating System - HP-UX
1848540 Members
8287 Online
104033 Solutions
New Discussion

Re: Disaster Recovery scripts

 
Donald C Nelson
Frequent Advisor

Disaster Recovery scripts

Does anyone have any information on Disaster Recovery scripts that would allow me to recreate my VG's and LV's at a DR site without having to manually re-create them?
5 REPLIES 5
Rita C Workman
Honored Contributor

Re: Disaster Recovery scripts

Well I use MC/SG (Continental Cluster) to fail over from site to site...

Rgrds,
Rita
Donald C Nelson
Frequent Advisor

Re: Disaster Recovery scripts

Thanks for the reply but I won't be using MC/Service Guard, but just bringing my ignite tapes and system info from the home server to the hot site.
Patrick Wallek
Honored Contributor

Re: Disaster Recovery scripts

There is really no way to automate that. When recreating LVs and VGs at a DR site you most likely will not know the device files for the disks ahead of time. You may also have different disk sizes which will influence the number of disks per VG and possibly other VG parameters.

For VG creation you could just write a simple script and just add the values for the disk device files once you are at the DR site.

LV creation can be easily scripted as well, since that just depends on the VGs. Just do a series of lvcreate and newfs commands and you are set for the LVs.
Ken Penland_1
Trusted Contributor

Re: Disaster Recovery scripts

some prep work would need to be done...here is what we do:

Whenever there is a change to your volume group info:
strings /etc/lvmtab | grep -v vg00 | grep dev | grep -v dsk | cut -f3 -d"/" > /midtier/vgs

then:
for i in `cat /midtier/vgs`
do
/usr/sbin/vgexport -m /midtier/${i}mapfile -p -s -v $i
sleep 2
done

this will create a mapfile of all your lvols n stuff...
on the new box:

for i in `cat /midtier/vgs`
do
mkdir /dev/$i
mknod /dev/$i/group c 64 0x0${count}0000
echo "ok..importing $i"
/usr/sbin/vgimport -m /midtier/${i}mapfile -s -v $i
/usr/sbin/vgchange -a y $i
count=`expr $count + 1`
sleep 3
done
'
Donald C Nelson
Frequent Advisor

Re: Disaster Recovery scripts

I will go with the my automated scripts plus responses from the forum.