File: init

package info (click to toggle)
lvm-common 1.5.5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 256 kB
  • ctags: 1,100
  • sloc: ansic: 1,697; sh: 98; makefile: 64
file content (37 lines) | stat: -rw-r--r-- 637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
#
# lvm		This script handles the LVM startup/shutdown
#		so that LVMs are properly configured and available.
#

# try to load module in case that hasn't been odne yet
modprobe lvm >/dev/null 2>&1
modprobe lvm-mod >/dev/null 2>&1

[ -e /proc/lvm ] || exit 0
[ -e /etc/lvmtab ] || exit 0
[ -x /sbin/vgscan ] || exit 0

case "$1" in
	start|"")
		echo "Setting up LVM Volume Groups..."
		/sbin/vgscan
		/sbin/vgchange -a y
		;;
	
	stop)
		echo "Shutting down LVM Volume Groups... "
		/sbin/vgchange -a n
		;;

	restart|force-reload)
		$0 stop
		sleep 3
		$0 start
		;;
	
	*)
		echo "Usage: lvm {start|stop}" >&2
		exit 1
		;;
esac