1 # Copyright (C) 2009 Red Hat, Inc. All rights reserved.
3 # This file is part of LVM2.
7 # These rules create symlinks for LVM logical volumes in
8 # /dev/VG directory (VG is an actual VG name). Some udev
9 # environment variables are set (they can be used in later
11 # DM_LV_NAME - logical volume name
12 # DM_VG_NAME - volume group name
13 # DM_LV_LAYER - logical volume layer (blank if not set)
15 # "add" event is processed on coldplug only!
16 ACTION!="add|change", GOTO="lvm_end"
17 ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="lvm_end"
18 ENV{DM_UUID}!="LVM-?*", GOTO="lvm_end"
19 ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}=="1", GOTO="lvm_end"
21 # Use DM name and split it up into its VG/LV/layer constituents.
22 IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup splitname --nameprefixes --noheadings --rows $env{DM_NAME}"
24 # Do not create symlinks for inappropriate subdevices.
25 ENV{DM_LV_NAME}=="?*_mimage_[0-9]*|pvmove?*|?*_vorigin", GOTO="lvm_disable"
26 ENV{DM_LV_LAYER}=="?*", GOTO="lvm_disable"
28 # Create symlinks for top-level devices only.
29 ENV{DM_VG_NAME}=="?*", ENV{DM_LV_NAME}=="?*", SYMLINK+="$env{DM_VG_NAME}/$env{DM_LV_NAME}", GOTO="lvm_end"
32 ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="1"
33 ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1"