Operating System - HP-UX
1846895 Members
4118 Online
110256 Solutions
New Discussion

ownership of LVs got changed upon failover

 
SOLVED
Go to solution
amithp
Frequent Advisor

ownership of LVs got changed upon failover

Hi,

We have a 2 node cluster running oracle database and having raw filesystems.

Those raw filesystems(LVs) have owner as oracle and group as dba. Today when the fail over took place one of the VGs got its all raw LVs' owner changed to root. Could you please advise why this happend? This happend only for LVs of one particular vg. and we had to change ownership manually to start the DB.


Regards
Amit
6 REPLIES 6
Turgay Cavdar
Honored Contributor

Re: ownership of LVs got changed upon failover

Hi,
Have you set the ownership of the device files on the fail over node before? You have to do this after every vgexport/vgimport manually.
amithp
Frequent Advisor

Re: ownership of LVs got changed upon failover

No.

We have many servers like this in our environment and we never change the ownership after failover. Moreover this had to be done on LVs of only one VG. LVs of other VGs were fine and had right ownership.


Turgay Cavdar
Honored Contributor

Re: ownership of LVs got changed upon failover

This means someone set it before, then you never hasve done vgexport/vgimport.
amithp
Frequent Advisor

Re: ownership of LVs got changed upon failover

vgexport and import are part of cluster failover. nobody changed the ownership of other LVs. moreover whenever some LV(raw fs) is created the in the active node entire VG is exported (in perview mode to generate map files) and imported in the inactive node. the ownership is changed before this export/import is done
Doug O'Leary
Honored Contributor
Solution

Re: ownership of LVs got changed upon failover

Hey;

Ownership of the devices changes to root when you do vgimport. Chances are an LV was added to or deleted from this vg on the primary node and someone appropriately reexported the vg to the other nodes.

On my SAP clusters, this happens regularly - to the point that I added a function to update the ownership prior to starting SAP.

function update_owner
{ owner="orae1p:dba"
set -A vgs vgsapdataE1P vgsapdata1E1P vgsapdata2E1P vgsapdata3E1P

for vg in ${vgs[*]}
do
echo "Updating ownership of lvs in ${vg}"
for lv in $(vgdisplay -v ${vg} | grep -i 'lv name' | awk '{print $NF}')
do
chown ${owner} ${lv%/*}/r${lv##*/}
done
done
}

Then call that function before anything else.

Works like a champ and you never have to worry about raw ownership again.

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
amithp
Frequent Advisor

Re: ownership of LVs got changed upon failover

Thanks Doug very much.
I got the answer.