System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

programatically find second disk, to mirror?

 
SOLVED
Go to solution
Donny Jekels
Respected Contributor

programatically find second disk, to mirror?

okay,

we have multiple models, and they all differ, this is understandable. however I am in the process of writting a post install script for our ignite server, that will find the second disk, regardless of model and mirror root vol to it.

I know the mirror process, I need to find out if anyone has a tool that will always display the second disk, regardless of model and it must be on a different controller.
"Vision, is the art of seeing the invisible"
5 REPLIES 5
Kent Ostby
Honored Contributor

Re: programatically find second disk, to mirror?

It would take some time to put it all together, put you could use:

lvlnboot -v
to find out the current root disk

ioscan -fNC disk
to find out the possible alternate disks

And if you have a candidate disk, you can use "pvdisplay" to see if it already is in use as a physical volume or check /etc/lvmtab to see if its already in use there.

From here its a matter of scripting it and there are several methods for that.

I dont have time right now to write one up, but might be able to come up with a script later today.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Donny Jekels
Respected Contributor

Re: programatically find second disk, to mirror?

Kent,

yes this is tricy, writing the script is the easy part. fidning which disk to use for which model turns out to be more difficult than expected.

yes I can use a lookup table, for each model and hard code the value of the hardware addy, however this is not the route I wish to go.

I will post the tool here once complete!
"Vision, is the art of seeing the invisible"
James R. Ferguson
Acclaimed Contributor

Re: programatically find second disk, to mirror?

Hi Donny:

I suggest that you use 'diskinfo' (man 'diskinfo' for more information, obviously) to analyze the candidate disk pool such that you select a device that satisfies (at least) size and perhaps model.

Regards!

...JRF...
Highlighted
Brendan Newport_2
Frequent Advisor
Solution

Re: programatically find second disk, to mirror?

Attached is Ed Jones ignite_mirror.ksh script. Ed is a HP ASE and his script found its way onto one of my servers.

I hope Ed wouldn't mind having his script seen, but I suspect its found its way onto other servers worldwide.

It isn't entirely completely automatic, as it anticipates that whatever the mirror disk script is, it'll have been defined as the ALTERNATE_DISK. If the disk is suitable, and most importantly, is on an alternate controller, then it will perform the mirroring task.

I've used the script when setting-up an rp7410, and tested the alternate booting sequence without errors...


Bren
Stuart Abramson_2
Honored Contributor

Re: programatically find second disk, to mirror?

I would say that you can't automate this 100%. You could narrow down candidates by model, size, address, etc, but sometimes you can't be sure without tracing cables, etc.