summaryrefslogtreecommitdiffstats
path: root/hooks/lvm2
blob: 1eaae9a9c484fca401578a4b2352e6d0a928bb8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# vim:set ft=sh:
run_hook ()
{
    mkdevice () { /bin/mknod "/dev/mapper/control" c ${1} ${2}; }

    /bin/modprobe -q dm-mod >/dev/null 2>&1
    if [ -e "/sys/class/misc/device-mapper" ]; then
        read dev_t < /sys/class/misc/device-mapper/dev
        OLDIFS=$IFS; IFS=:
        mkdevice $dev_t
        IFS=$OLDIFS

        msg "Scanning logical volumes..."
        /bin/lvm vgscan --ignorelockingfailure
        msg "Activating logical volumes..."
        /bin/lvm vgchange --ignorelockingfailure -ay
    fi
}