Operating System - Linux
1823143 Members
3620 Online
109647 Solutions
New Discussion юеВ

vgchange cluster filesystems

 
Simon Hargrave
Honored Contributor

vgchange cluster filesystems

(working with RHEL AS3)

We have some shared disk on an MSA array with a volume group created and published to 2 nodes. Whilst not technically a cluster (we're not using serviceguard or anything, we're working with manual failver) we want this volume group to not be activated on boot, for obvious reasons.

Now I tried changing /etc/rc.d/rc.sysinit to only vgchange vg00 but this didn't work. I then tracked it down to being a vgchange -ay in the linuxrc in the initrd script. Clearly I don't want to have to mount/edit/unmount the initrd file every time I change the kernel/mkinitrd, so how can I ensure that eg vg01 does not get vgchanged on bootup?

Is it enough just to perform a vgchange -n vg01 at the end of rc.sysinit for example, since filesystems haven't actuallt been mounted? Though this does seem a little dirty...
4 REPLIES 4
Hoefnix
Honored Contributor

Re: vgchange cluster filesystems

Simon,

In my distro (SuSE 9.3) I have the config file:/etc/sysconfig/lvm

## Path: System/File systems/LVM
## Description: LVM configuration
## Type: string
## Default: ""
#
# This variable allows to only activate the LVM volume groups listed at
# bootup. If it is empty, all LVM volume groups are activated at bootup.
# This variable needs setting only under very special circumstances.
# For almost all standard LVM installations it can safely stay empty.
#
LVM_VGS_ACTIVATED_ON_BOOT=""



By changing this LVM_VGS_ACTIVATED_ON_BOOT you can reach what you want.

HTH,
Peter
Serviceguard for Linux
Honored Contributor

Re: vgchange cluster filesystems

even though you are not using Serviceguard, check out the latest manuals. They have the instructions on how to prevent VG start on boot.

docs.hp.com

Here's what I have in a presentation.

On Red Hat, use the following procedure to prevent a vgscan command at boot time:
After your volume groups have been created on a node, back them upusing vgcfgbackup, then comment out the following lines in the /etc/rc.d/rc.sysinit file:
# LVM initialization
if [ -e /proc/lvm -a -x /sbin/vgchange -a -f /etc/lvmtab ];
then
action $"Setting up LVM:" /sbin/vgscan && /sbin/vgchange -a y
fi
Commenting out these lines will prevent the vgscan from removing the old volume group device files.
Simon Hargrave
Honored Contributor

Re: vgchange cluster filesystems

Thank Peter however that option doesn't exist in RedHat.

Thanks "ServiceGuard", however that doesn't solve the problem. All that does is stop the vgscan (which is actually a bad thing, because if LUNs get republished out-of-order then device filenames will mismatch - without the vgscan this will result in failed volume groups). The problem occurs with the vgchange during the initrd execution, before rc even begins. It is this I wish to stop.
Bob_Vance
Esteemed Contributor

Re: vgchange cluster filesystems

I wouldn't have a problem with *either* option.

I would say that adding a 'vgchange -a n ...' wouldn't be any dirtier than than how we are already modifying /etc/rc.d/rc.sysinit when installing SG.

Changing /linuxrc after modifying the kernel would be slightly safer, I suppose. You could modify the 'mkinitrd' script to remind you to make the change when finished. Of course, you always have to worry about updates and patches changing mkinitrd. You could then have a cron job that checks mkinitrd for modification (e.g., cksum) and e-mail to remind you that the mkinitrd had been changed.

I recently installed SG on RH ES3u5.
That /initrd/linuxrc doesn't have any vgchange (or any reference to LVM, for that matter). However, it is also not booting from LVM (no vg00), so I suspect that that's the reason.


FWIW
When I made the change to rc.sysinit, I left the vgscan intact:

#x# action $"Setting up Logical Volume Management:" /sbin/vgscan && /sbin/vgchange -a y # #20050729jrv
action $"Setting up Logical Volume Management:" /sbin/vgscan # #20050729jrv
## activate nonSG VGs here manually # #20050729jrv
: /sbin/vgchange -a y vgXX # #20050729jrv

Here, I had no non-SG VGs (not using LVM for vg00), so just my comments are extant.


bv
"The lyf so short, the craft so long to lerne." - Chaucer