I took a look a the newest LVM package. It has a udev rules file, 11-dm-lvm.rules, which looks like it should do fine to create the symlinks for valid lvs. Does vgchange -ay do more than that? Here is the file:
# Copyright (C) 2009 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
# Udev rules for LVM.
#
# These rules create symlinks for LVM logical volumes in
# /dev/VG directory (VG is an actual VG name). Some udev
# environment variables are set (they can be used in later
# rules as well):
# DM_LV_NAME - logical volume name
# DM_VG_NAME - volume group name
# DM_LV_LAYER - logical volume layer (blank if not set)
# "add" event is processed on coldplug only!
ACTION!="add|change", GOTO="lvm_end"
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="lvm_end"
ENV{DM_UUID}!="LVM-?*", GOTO="lvm_end"
# Use DM name and split it up into its VG/LV/layer constituents.
IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup splitname --nameprefixes --noheadings --rows $env{DM_NAME}"
# Do not create symlinks for inappropriate subdevices.
ENV{DM_LV_NAME}=="pvmove?*|?*_vorigin", GOTO="lvm_disable"
ENV{DM_LV_LAYER}=="?*", GOTO="lvm_disable"
I took a look a the newest LVM package. It has a udev rules file, 11-dm-lvm.rules, which looks like it should do fine to create the symlinks for valid lvs. Does vgchange -ay do more than that? Here is the file:
# Copyright (C) 2009 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
# Udev rules for LVM.
#
# These rules create symlinks for LVM logical volumes in
# /dev/VG directory (VG is an actual VG name). Some udev
# environment variables are set (they can be used in later
# rules as well):
# DM_LV_NAME - logical volume name
# DM_VG_NAME - volume group name
# DM_LV_LAYER - logical volume layer (blank if not set)
# "add" event is processed on coldplug only! ="add|change" , GOTO="lvm_end" UDEV_RULES_ VSN}!=" ?*", GOTO="lvm_end" UUID}!= "LVM-?* ", GOTO="lvm_end"
ACTION!
ENV{DM_
ENV{DM_
# Use DM name and split it up into its VG/LV/layer constituents. program} ="$env{ DM_SBIN_ PATH}/dmsetup splitname --nameprefixes --noheadings --rows $env{DM_NAME}"
IMPORT{
ENV{DM_ UDEV_DISABLE_ SUBSYSTEM_ RULES_FLAG} =="1", GOTO="lvm_end"
# Do not create symlinks for inappropriate subdevices. LV_NAME} =="pvmove? *|?*_vorigin" , GOTO="lvm_disable" LV_LAYER} =="?*", GOTO="lvm_disable"
ENV{DM_
ENV{DM_
# Create symlinks for top-level devices only. VG_NAME} =="?*", ENV{DM_ LV_NAME} =="?*", SYMLINK+ ="$env{ DM_VG_NAME} /$env{DM_ LV_NAME} ", GOTO="lvm_end"
ENV{DM_
LABEL="lvm_disable" UDEV_DISABLE_ DISK_RULES_ FLAG}=" 1" UDEV_DISABLE_ OTHER_RULES_ FLAG}=" 1"
ENV{DM_
ENV{DM_
OPTIONS:="nowatch"
LABEL="lvm_end"