mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
8c670f8349
sourced from http://poochiereds.net/svn/lvm2/
34 lines
724 B
Bash
34 lines
724 B
Bash
#!/bin/sh
|
|
|
|
# $Id$
|
|
|
|
# simple startup script to create lvm2 devices if /dev is a mountpoint, there
|
|
# are active dm- devices, and an executable /sbin/vgscan.
|
|
|
|
# this script is licensed under GPLv2.
|
|
# See http://www.gnu.org/licenses/gpl.html
|
|
|
|
case $1 in
|
|
start)
|
|
# is /dev a mountpoint?
|
|
mountpoint -q /dev
|
|
DEVMNTPOINT=$?
|
|
|
|
# check to see if there are active dm entries under /sys
|
|
ls /sys/block/dm-*/dev 1>/dev/null 2>&1
|
|
ACTIVEDMDEVS=$?
|
|
|
|
# mknodes if conditions are right
|
|
if [ $DEVMNTPOINT -eq 0 -a $ACTIVEDMDEVS -eq 0 -a -x /sbin/vgscan ]; then
|
|
/sbin/vgscan --mknodes --ignorelockingfailure
|
|
fi
|
|
;;
|
|
stop)
|
|
exit 0
|
|
;;
|
|
*)
|
|
echo "usage:"
|
|
echo " $0 start|stop"
|
|
;;
|
|
esac
|