Operating System - Linux
1826095 Members
4595 Online
109690 Solutions
New Discussion

Re: Activate volume group on boot

 
Thomas Soukup
Occasional Contributor

Activate volume group on boot

I have a system (rs5670, Red Har AS 2.1) on which I have defined a 2TB logical volume. The lv appears to be working, except that when I boot the server, the volume group is not activated and I get an error when I try to mount the volume. I can boot without mounting the volume and use vgchange to activate the volume group. I can then mount the logical volume.

What am I missing in getting the group to activate properly on boot. This is suppose to be the default as I understand it.

Thanks,
Tom
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: Activate volume group on boot

take a look at /etc/fstab

You probably need an entry there to insure that the vg and filesystems get mounted at boot time.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mark Grant
Honored Contributor

Re: Activate volume group on boot

Hi,

I've never used LVM on Red Hat but I have on nearly everything else. Start up scripts generally don't activate volume groups like they do on HP-UX.

Every system I have seen on Linux does a vgscan somewhere in the startup scripts and then do a vgchange -ay to activate discovered volume groups..

Of course, you don't have to do it this way. You could emulate other unix's by writing a script to look for filesystems in /etc/fstab and cross referencing them with /etc/lvmtab and activate the resulting volume groups. You could then put this script in the startup script directory.

On the other hand, in many cases, with linux, the vgscan appraoch works fine.

Regards
Never preceed any demonstration with anything more predictive than "watch this"
Paulo A G Fessel
Trusted Contributor

Re: Activate volume group on boot

This is what Mandrake 9.1 does. It's in /etc/rc.d/sysinit:

# LVM initialization
if [ -f /etc/lvmtab -a ! -e /proc/lvm ] ; then
modprobe lvm-mod >/dev/null 2>&1
fi
if [ -e /proc/lvm -a -x /sbin/vgchange -a -f /etc/lvmtab ]; then
action "Setting up Logical Volume Management:" /sbin/vgscan && /sbin/vgchange -a y
fi

Probably you have to modify your rc.sysinit or update your initscripts package.

HTH
Paulo Fessel
L'employé propose, le boss dispose.
Steven E. Protter
Exalted Contributor

Re: Activate volume group on boot

Paulo's post makes it obvious that with lvm comes the vgchagne command.

Thats how to activate the vg.

It should stay active after 1 or 100 boots.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
K.C. Chan
Trusted Contributor

Re: Activate volume group on boot

Tom,
are you using lvm + raid? AFAIK, this happen to me before, I got around it by hacking the startup script. Apparently there's an error a bug in the start up script. LVM failed to activate because of if else clause which test for raid and lvm, it doesn't detect it correctly so it just wooosh over it. Hope this help.
Reputation of a thousand years can be determined by the conduct of an hour
Ollie R
Respected Contributor

Re: Activate volume group on boot

Hi Tom,

Paulo hit on the problem - under RH there is no "modprobe lvm-mod" in the "/etc/rc.sysinit" file.

Simply add the command as shown in the example by Paulo and this will work fine.

Hope this helps,

Ollie.
To err is human but to not award points is unforgivable