관리-도구
편집 파일: 11-dm-mpath.rules
ACTION!="add|change", GOTO="mpath_end" ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="mpath_end" ENV{DM_UUID}!="mpath-?*", GOTO="mpath_end" IMPORT{db}="DM_DISABLE_OTHER_RULES_FLAG_OLD" IMPORT{db}="MPATH_DEVICE_READY" # If this uevent didn't come from dm, don't try to update the # device state ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", IMPORT{db}="DM_UDEV_DISABLE_OTHER_RULES_FLAG", IMPORT{db}="DM_NOSCAN", GOTO="scan_import" ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" # multipath sets DM_SUBSYSTEM_UDEV_FLAG2 when it reloads a # table with no active devices. If this happens, mark the # device not ready ENV{DM_SUBSYSTEM_UDEV_FLAG2}=="1", ENV{MPATH_DEVICE_READY}="0",\ GOTO="mpath_action" # If the last path has failed mark the device not ready ENV{DM_ACTION}=="PATH_FAILED", ENV{DM_NR_VALID_PATHS}=="0",\ ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action" # Don't mark a device ready on a PATH_FAILED event. even if # DM_NR_VALID_PATHS is greater than 0. Just keep the existing # value ENV{DM_ACTION}=="PATH_FAILED", GOTO="mpath_action" # This event is either a PATH_REINSTATED or a table reload where # there are active paths. Mark the device ready ENV{MPATH_DEVICE_READY}="" LABEL="mpath_action" # DM_SUBSYSTEM_UDEV_FLAG0 is the "RELOAD" flag for multipath subsystem. # Drop the DM_ACTIVATION flag here as mpath reloads tables if any of its # paths are lost/recovered. For any stack above the mpath device, this is not # something that should be reacted upon since it would be useless extra work. # It's exactly mpath's job to provide *seamless* device access to any of the # paths that are available underneath. ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", ENV{DM_ACTIVATION}="0" # Do not initiate scanning if no path is available, # otherwise there would be a hang or IO error on access. # We'd like to avoid this, especially within udev processing. ENV{MPATH_DEVICE_READY}=="0", ENV{DM_NOSCAN}="1" # Also skip all foreign rules if no path is available. # Remember the original value of DM_DISABLE_OTHER_RULES_FLAG # and restore it back once we have at least one path available. ENV{MPATH_DEVICE_READY}=="0", ENV{.MPATH_DEVICE_READY_OLD}!="0",\ ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}=="",\ ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}",\ ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" ENV{MPATH_DEVICE_READY}!="0", ENV{.MPATH_DEVICE_READY_OLD}=="0",\ ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="$env{DM_DISABLE_OTHER_RULES_FLAG_OLD}",\ ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="",\ ENV{DM_ACTIVATION}="1" LABEL="scan_import" ENV{DM_NOSCAN}!="1", GOTO="mpath_end" ENV{ID_FS_TYPE}!="?*", IMPORT{db}="ID_FS_TYPE" ENV{ID_FS_USAGE}!="?*", IMPORT{db}="ID_FS_USAGE" ENV{ID_FS_UUID}!="?*", IMPORT{db}="ID_FS_UUID" ENV{ID_FS_ENC}!="?*", IMPORT{db}="ID_FS_UUID_ENC" ENV{ID_FS_VERSION}!="?*", IMPORT{db}="ID_FS_VERSION" LABEL="mpath_end"