summaryrefslogtreecommitdiffstats
path: root/hooks/lvm2
diff options
context:
space:
mode:
Diffstat (limited to 'hooks/lvm2')
-rw-r--r--hooks/lvm218
1 files changed, 18 insertions, 0 deletions
diff --git a/hooks/lvm2 b/hooks/lvm2
new file mode 100644
index 0000000..a1788ce
--- /dev/null
+++ b/hooks/lvm2
@@ -0,0 +1,18 @@
+# vim:set ft=sh:
+run_hook ()
+{
+ mkdevice () { /bin/mknod "/dev/mapper/control" c ${1} ${2}; }
+
+ if [ -e "/sys/class/misc/device-mapper" ]; then
+ /bin/modprobe -q dm-mod >/dev/null 2>&1
+ 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
+}