[linux-lvm] vgscan & vgchange -a y location in startup scripts

Heinz Mauelshagen mauelsha at ez-darmstadt.telekom.de
Sun Apr 25 19:53:26 UTC 1999


> 
> On my Alpha, with RedHat 5.2 (SysV style init), where exactly should I
> put the vgscan and vgchange -a y?
> 
> ** Should I put it in /etc/init.d/rc.sysinit?  And if so, should it be
> AFTER mounting / and /proc (but before, of course, mounting anything
> else)?

Yes, put it there.
/ has to mounted (see assumption below), /proc doesn't before running vgscan.

> 
> ** Should it be after fsck runs?
> 
> I have the kernel patched and lvm installed (with patch) and I'm ready
> to try it out.  But I need to know just where to put vgscan and vgchange
> -a y!
> 

vgscan accesses /etc/lvmtab.d read/write.
If you want to stay with this directory and its contents in your root
filesystem, do a fsck root and a vgscan afterwards followed by
the "vgchange -ay".

A script fragment follows from my /sbin/init.d/boot on SuSE.
There's a redundand ro mount in it, because SuSEs boot script
remounts / rw afterwards again :)

#############################################################################
#
# Find and activate volume groups (HM 1/1/1999)
#
if [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
   while read line; do
      set -- $line
      if [ "$2" = "/" ]; then
         root=$1
         type=$3
         break
      fi
   done < /etc/fstab

   fsck -y -t $type $root; ret=$?

   if [ $ret -eq 0 ]; then
      echo "Remounting / read/write for vgscan..."
      mount -n -o remount,rw /
      echo "Scanning for LVM volume groups..."
      /sbin/vgscan
      mount -n -o remount,ro /
      echo "Activating LVM volume groups..."
      /sbin/vgchange -ay
   else
      echo "Error checking / for vgscan..." >&2
   fi
else
   echo "Skipping LVM activation..."
fi
#
# End find and activate volume groups (HM)
#
#############################################################################


Regards,
Heinz

--

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Systemmanagement C/S                             Deutsche Telekom AG
                                                 Entwicklungszentrum Darmstadt
Heinz Mauelshagen                                Otto-Roehm-Strasse 71c
Senior Systems Engineer                          Postfach 10 05 41
                                                 64205 Darmstadt
mge at ez-darmstadt.telekom.de                      Germany
                                                 +49 6151 886-425
                                                          FAX-386
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



More information about the linux-lvm mailing list