Operating System - HP-UX
1836970 Members
2254 Online
110111 Solutions
New Discussion

Re: lvmrc and fstab question.

 
Juan Manuel López
Valued Contributor

lvmrc and fstab question.

Hi all.
I have a service guard cluster running and controling the activation of vg.
The /etc/lvmrc file has an auto_vg_activation=0. This mean that the system will only activate vg00 on startup, any other vg will be activated by cluster software...so I have another vg outside cluster configuration...I should modify the lvmrc " custom_vg_activation funtion " to include my vg and ALSO include the fs of this vg on /etc/fstab ?.


Thanks.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
5 REPLIES 5
Rajeev  Shukla
Honored Contributor

Re: lvmrc and fstab question.

Hi,
You are right.
modify the /etc/lvmrc to have custom vg activitaion and include the include vg00 and other VG you want to activate.(Dont make auto_vg_activation=1, leave that to 0) Just uncommet the custom vg activation. And include the filesystem to be mounted in /etc/fstab

Cheers
Rajeev
Jose Mosquera
Honored Contributor

Re: lvmrc and fstab question.

Hi Juanma,

We have a two nodes cluster running under service guard A.11.14 (HP-UX 11) and the adoptive node configuration is:

#cat /etc/lvmrc
.
.
.
AUTO_VG_ACTIVATE=0
.
.
custom_vg_activation()
{
# e.g. /sbin/vgchange -a y -s
# parallel_vg_sync "/dev/vg00 /dev/vg01"
# parallel_vg_sync "/dev/vg02 /dev/vg03"
vgchange -a y /dev/vg01
vgchange -a y /dev/vg02
vgchange -a y /dev/vg03
vgchange -a y /dev/vg04
vgchange -a y /dev/vg99
return 0
}

Then, in the /etc/fstab we have defined:
#cat /etc/fstab
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /tmp vxfs delaylog 0 2
/dev/vg00/lvol5 /home vxfs delaylog 0 2
/dev/vg00/lvol6 /opt vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
/dev/vg01/lvol1 /misc vxfs rw,suid,largefiles,delaylog,datainlog 0 2
/dev/vg01/lvol2 /oraclesoft vxfs rw,suid,largefiles,delaylog,datainlog 0 2
/dev/vg01/lvol3 /4GL vxfs rw,suid,largefiles,delaylog,datainlog 0 2
/dev/vg02/lvol1 /archive vxfs rw,suid,largefiles,delaylog,datainlog 0 2
/dev/vg04/lvol1 /orarep vxfs rw,suid,largefiles,delaylog,datainlog 0 2
/dev/vg99/lvol99 /datdisold vxfs rw,suid,largefiles,delaylog,datainlog 0 2
/dev/vg03/lvol1 /oradat vxfs delaylog,nodatainlog,largefiles,rw,suid 0 2
/dev/vg01/backups /backups vxfs rw,suid,largefiles,delaylog,datainlog 0 2

As you see we have defined in both of them files. This is a tested production environment and works fine!

I hope it is you useful.

Rgds.
melvyn burnard
Honored Contributor

Re: lvmrc and fstab question.

so which of these vgs and file systems are in your Sg packages? none of them?
if any ARE in a package, hten htey should not be defined here.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Trond Haugen
Honored Contributor

Re: lvmrc and fstab question.

Yes you are right.
Default is auto_vg_activation=0 but in a SG cluster you have to turn it off as SG will have to handle the activation depending on which node is running the package. Thus you will have to add the activation of other (non SG) volume groups to /etc/lvmtab and mount them thru fstab.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Colin Topliss
Esteemed Contributor

Re: lvmrc and fstab question.

We have the same problem. However, I tackled it in a slightly different way, because we have inexperienced people who keep forgetting to add entries to the lvmrc file (so volumes are not activated and subsequently not mounted, causing all sorts of problems).

We use the following custom_vg_activation function (replacing the original):

custom_vg_activation()
{
# lvmrc custom_vg_activation
#
# We only have shell built-ins and /sbin to work with.
# That means no sort, grep, sed etc. DOH!!!
#

for vg_name in `cat /etc/fstab |awk '{print $1}'`
do
vg_name=${vg_name%/*}
case $vg_name in
/dev/vg00)
# We don't do anything with vg00
;;
/dev/vg*)
if [ $vg_name != $s_vg_sync* ]
then
if [ -d $vg_name ]
then
vgchange -a y $vg_name
s_vg_sync=$s_vg_sync"$vg_name "
else
echo "Unable to activate $vg_name - Please check"
fi
fi
;;
esac
done
parallel_vg_sync $s_vg_sync

return 0
}




Now all we have to do is ensure that the fstab is up to date and everything else is handled automatically - no more updating the lvmrc file!