2006-12-18 14:01:39 +01:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2001 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
|
|
|
#
|
|
|
|
# /etc/init.d/boot.lvm
|
|
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: boot.lvm
|
2012-10-18 10:15:42 +02:00
|
|
|
# Required-Start: boot.udev boot.rootfsck
|
|
|
|
# Should-Start: boot.device-mapper boot.multipath boot.md boot.dmraid
|
2008-08-14 01:57:23 +02:00
|
|
|
# Required-Stop: $null
|
|
|
|
# Should-Stop: $null
|
2006-12-18 14:01:39 +01:00
|
|
|
# Default-Start: B
|
|
|
|
# Default-Stop:
|
2012-10-23 19:40:13 +02:00
|
|
|
# Short-Description: Start LVM2
|
2006-12-18 14:01:39 +01:00
|
|
|
# Description: start logical volumes
|
|
|
|
### END INIT INFO
|
|
|
|
|
|
|
|
. /etc/rc.status
|
|
|
|
. /etc/sysconfig/lvm
|
|
|
|
|
|
|
|
# udev interaction
|
2008-09-25 01:03:54 +02:00
|
|
|
if [ -x /sbin/udevadm ] ; then
|
2006-12-18 14:01:39 +01:00
|
|
|
[ -z "$LVM_DEVICE_TIMEOUT" ] && LVM_DEVICE_TIMEOUT=60
|
|
|
|
else
|
|
|
|
LVM_DEVICE_TIMEOUT=0
|
|
|
|
fi
|
|
|
|
|
|
|
|
rc_reset
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
#
|
|
|
|
# Find and activate volume groups (HM 1/1/1999)
|
|
|
|
#
|
|
|
|
if test -d /etc/lvm -a -x /sbin/vgscan -a -x /sbin/vgchange ; then
|
|
|
|
# Waiting for udev to settle
|
|
|
|
if [ "$LVM_DEVICE_TIMEOUT" -gt 0 ] ; then
|
|
|
|
echo "Waiting for udev to settle..."
|
2008-09-25 01:03:54 +02:00
|
|
|
/sbin/udevadm settle --timeout=$LVM_DEVICE_TIMEOUT
|
2006-12-18 14:01:39 +01:00
|
|
|
fi
|
|
|
|
echo "Scanning for LVM volume groups..."
|
|
|
|
/sbin/vgscan --mknodes
|
|
|
|
echo "Activating LVM volume groups..."
|
|
|
|
/sbin/vgchange -a y $LVM_VGS_ACTIVATED_ON_BOOT
|
|
|
|
|
|
|
|
rc_status -v -r
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
stop)
|
2008-05-01 15:03:59 +02:00
|
|
|
if test -d /etc/lvm -a -x /sbin/vgchange ; then
|
2006-12-18 14:01:39 +01:00
|
|
|
/sbin/vgchange -a n
|
|
|
|
fi
|
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
rc_failed 4
|
|
|
|
rc_status -v
|
|
|
|
;;
|
2008-05-01 15:03:59 +02:00
|
|
|
reload)
|
|
|
|
$0 start
|
|
|
|
;;
|
2006-12-18 14:01:39 +01:00
|
|
|
*)
|
2008-05-01 15:03:59 +02:00
|
|
|
echo "Usage: $0 {start|stop|status|reload}"
|
2006-12-18 14:01:39 +01:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
rc_exit
|