Skip to contentSkip to conversation

Startup/Shutdown scripts for RH6.2?

linux-lvm Jeffrey B Layton 3 participants 3 messages Feb 19, 2001 – Feb 20, 2001

lore
Share & tools
lore
#0 lore raw

Hello,

Of course I'm a newbie :) I'm been experimenting with LVM
prior to a production installation. I've got everything working pretty well with a RH6.2 installation and a custom kernel. However, I'm a bit stuck on the startup/shutdown scripts. I've tried a couple of things after searching the archives, but nothing seems to work (i.e. the volume groups are not found and then mount complains very loudly). Any suggestions/tips/code?

TIA,

Jeff Layton

#1 lore raw

I had the same problem too at one time. But I added appended script in /etc/rc.d/rc.sysinit right after the RAID initialization and right before the file system starts getting checked (before _RUN_QUOTACHECK). I added the stop script in /etc/init.d/halt.
I found this script in the group archive.

## LVM
#scan for VGs and create /dev entries.
if [ -x /sbin/vgscan -a -d /proc/lvm ]; then
action "LVM: Scanning for Volume Groups" /sbin/vgscan
fi
#activate all VGs
if [ -x /sbin/vgchange -a -e /proc/lvm ]; then
action "LVM: Activating Volume Groups" /sbin/vgchange -ay
fi
## End LVM

Hope this helps

Quoted 20 lines · Jeffrey B Layton

Hello,

Of course I'm a newbie :) I'm been experimenting with LVM
prior to a production installation. I've got everything working pretty well with a RH6.2 installation and a custom kernel. However, I'm a bit stuck on the startup/shutdown scripts. I've tried a couple of things after searching the archives, but nothing seems to work (i.e. the volume groups are not found and then mount complains very loudly). Any suggestions/tips/code?

TIA,

Jeff Layton

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm

#2 lore raw
Quoted 6 lines · Gashaw Mengistu

I had the same problem too at one time. But I added appended script in /etc/rc.d/rc.sysinit right after the RAID initialization and right before the file system starts getting checked (before _RUN_QUOTACHECK). I added the stop script in /etc/init.d/halt.
I found this script in the group archive.

Quoted 10 lines

## LVM
#scan for VGs and create /dev entries.
if [ -x /sbin/vgscan -a -d /proc/lvm ]; then
action "LVM: Scanning for Volume Groups" /sbin/vgscan
fi
#activate all VGs
if [ -x /sbin/vgchange -a -e /proc/lvm ]; then
action "LVM: Activating Volume Groups" /sbin/vgchange -ay
fi
## End LVM

This will only work (AFAICS) when LVM is compiled into the kernel, because /proc/lvm will not exist if it is a module. My startup has this first:

[ ! -e /proc/lvm ] && (modprobe lvm || modprobe lvm_mod) 2> /dev/null

Cheers, Andreas

Signature · 3 lines
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert