File: lvm2udev

package info (click to toggle)
lvm2 2.03.16-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-proposed-updates
  • size: 14,708 kB
  • sloc: ansic: 174,022; sh: 35,476; python: 5,698; makefile: 2,043; ruby: 66; awk: 20; cpp: 10
file content (33 lines) | stat: -rw-r--r-- 724 bytes parent folder | download | duplicates (8)
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
#!/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