Operating System - HP-UX
1833431 Members
3240 Online
110052 Solutions
New Discussion

script to rebuild lvm for DR

 
Dan Copeland
Regular Advisor

script to rebuild lvm for DR

Hello,

I was curious if anyone knew of a script that would recreate the LVM setup of a hp ux box from the /etc/fstab in a DR situation. My search didn't find much.

I'm recovering vg00 via ignite so I have the fstab after I boot off the tape, but I need to rebuild all my file systems before I can start restoring everything else via NetBackup.

I will try to write it myself if nothing is found--but I have a DR test in two weeks and I'm really busy.

tia,

Frank
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: script to rebuild lvm for DR

Hi Frank:

Since it appears that you will be doing your D/R at a remote site, you really have no way of knowing before hand the actual devices and configuration (number of physical volumes, size of physical volumes, etc.) you will have.

I simply keep simple scripts for each server I recover. The scripts offer skeletal 'pvcreate', 'vgcreate', 'lvcreate', and 'newfs' commands for each filesystem I'll need. Since you are using Ignite to recover vg00, your LVM group files and mountpoint directories will be recovered for you, although for documentary purposes it doesn't hurt to add these to your "build".

Regards!

...JRF...
Dan Copeland
Regular Advisor

Re: script to rebuild lvm for DR

If I was to write it myself, I was thinking of having a text file listing the physical devices files that I would build once on site and source that.

Everything else I have.
MANOJ SRIVASTAVA
Honored Contributor

Re: script to rebuild lvm for DR

Hi Frank

In such a case , I would first recover the root voulme and then rebuild the other moun points , I am assuming you are looking for a script which would automate the creation , I would prefer to do it maunally one at a time .
The only this that can be used as refernce it to document the current setting in terms of bdf , dmesg , ioscan ,sysinfo and keep these documents at the Second site.


Manoj Srivastava
Nick Wickens
Respected Contributor

Re: script to rebuild lvm for DR

I created an script which runs via cron every night in order to recreate all of the logical volumes etc that are needed for our Informix system. This script interogates the current setup and then creates a new script which can then be run to re-create the setup. The first thing the created script does is report how much disk space is required in each of the volume groups as this is something you can't easily do in a disaster as you will not know disk sizes /ids etc. Therefore all you need to do is create volume groups with just the physical volumes but no lvols.

Script is attached - Its really geared at recreating the many chunks for our Informix database but may give you some ideas .It has been used in anger to recover our systems successfully.
Hats ? We don't need no stinkin' hats !!
Nick Wickens
Respected Contributor

Re: script to rebuild lvm for DR

Ehhm What happended to my attachment ? Lets try again think poermissions wrong.
Hats ? We don't need no stinkin' hats !!
Nick Wickens
Respected Contributor

Re: script to rebuild lvm for DR

In addition the attached script is also run to produce a print for storage offsite for disaster purposes - There is some in house informix/omniback stuff in here and I am not a professional script writer (I just do it for a profession !!) but it may help.
Hats ? We don't need no stinkin' hats !!