PKGBUILDs/core/lvm2/lvm2_hook

19 lines
601 B
Text
Raw Normal View History

2009-10-10 02:17:35 +00:00
# vim:set ft=sh:
run_hook ()
{
/sbin/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
if [ ! -e "/dev/mapper/control" ]; then
/bin/mknod "/dev/mapper/control" c $(/bin/replace "${dev_t}" ':')
fi
[ "${quiet}" = "y" ] && LVMQUIET=">/dev/null"
msg "Scanning logical volumes..."
eval /bin/lvm vgscan --ignorelockingfailure $LVMQUIET
msg "Activating logical volumes..."
eval /bin/lvm vgchange --ignorelockingfailure -ay $LVMQUIET
fi
}