# This file causes block devices with LVM signatures to be automatically
# added to their volume group.
# See udev(8) for syntax

SUBSYSTEM!="block", GOTO="lvm_end"
ACTION!="add|change", GOTO="lvm_end"

ENV{ID_FS_TYPE}!="LVM2_member", GOTO="lvm_end"

ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-id/lvm2-pvuuid-$env{ID_FS_UUID_ENC}"

IMPORT{PROGRAM}="collect_lvm $tempnode"

ENV{VGUUID}!="?*", GOTO="lvm_end" 

ENV{VGNAME}!="?*", GOTO="lvm_end"

# If all related PV's available already, active all LVs inside.
ENV{COLLECT}=="0", RUN+="/sbin/vgchange -a y $env{VGNAME}"
 
LABEL="lvm_end"