lvm2: add hotplug script to scan and enable PVs on hotplug
[feed/packages.git] / utils / lvm2 / files / lvm2.hotplug
diff --git a/utils/lvm2/files/lvm2.hotplug b/utils/lvm2/files/lvm2.hotplug
new file mode 100644 (file)
index 0000000..0ef48c5
--- /dev/null
@@ -0,0 +1,6 @@
+
+[ "$ACTION" = "add" ] || return 0
+[ -e "/dev/$DEVNAME" ] || return 0
+
+/sbin/lvm vgscan --mknodes --devices /dev/$DEVNAME || :
+/sbin/lvm vgchange -aly --devices /dev/$DEVNAME || :