From a540b3f189a9aaaf87222190035db4161e336964 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 2 Oct 2023 23:09:22 +0200 Subject: [PATCH] make: generate --- conf/example.conf.in | 20 ++++++++++++++++++++ man/lvmdevices.8_pregen | 38 +++++++++++++++++++++++++++++++------- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/conf/example.conf.in b/conf/example.conf.in index 1709d0de0..773f2f483 100644 --- a/conf/example.conf.in +++ b/conf/example.conf.in @@ -151,6 +151,26 @@ devices { # This configuration option has an automatic default value. # search_for_devnames = "auto" + # Configuration option devices/device_ids_refresh. + # Find PVs on new devices and update the device IDs in the devices file. + # If PVs are restored or moved to a new system with new devices, but + # an old system.devices remains with old device IDs, then search for + # the PVIDs on new devices and update the device IDs in system.devices. + # The original device IDs must also not be found on the new system. + # See device_ids_refresh_check for conditions that trigger the refresh. + # This configuration option has an automatic default value. + # device_ids_refresh = 1 + + # Configuration option devices/device_ids_refresh_checks. + # Conditions that trigger device_ids_refresh to locate PVIDs on new devices. + # product_uuid: refresh if /sys/devices/virtual/dmi/id/product_uuid does not + # match the value saved in system.devices. + # hostname: refresh if hostname does not match the value saved in system.devices. + # (hostname is used if product_uuid is not available.) + # Remove values from this list to prevent lvm from using them. + # This configuration option has an automatic default value. + # device_ids_refresh_checks = [ "product_uuid", "hostname" ] + # Configuration option devices/filter. # Limit the block devices that are used by LVM commands. # This is a list of regular expressions used to accept or reject block diff --git a/man/lvmdevices.8_pregen b/man/lvmdevices.8_pregen index 608893d8c..f57ecbe76 100644 --- a/man/lvmdevices.8_pregen +++ b/man/lvmdevices.8_pregen @@ -97,13 +97,13 @@ will scan devices outside the devices file to locate PVs on renamed devices. A config setting search_for_devnames can be used to control the scanning for renamed devname entries. .P -Related to the devices file, the new command option --devices +Related to the devices file, the command option --devices allows a list of devices to be specified for the command to use, overriding the devices file. The listed devices act as a sort of devices file in terms of limiting which devices lvm will see and use. Devices that are not listed will appear to be missing to the lvm command. .P -Multiple devices files can be kept \fI#DEFAULT_SYS_DIR#/devices\fP, which +Multiple devices files can be kept in \fI#DEFAULT_SYS_DIR#/devices\fP, which allows lvm to be used with different sets of devices. For example, system devices do not need to be exposed to a specific application, and the application can use lvm on its own devices that are not exposed to the @@ -139,12 +139,20 @@ Possible device ID types are: .br .IP \[bu] 2 .B sys_wwid -uses the wwid reported by sysfs. This is the first choice for non-virtual -devices. +uses the wwid reported by the wwid sysfs file. This is the first choice. +.IP \[bu] 2 +.B wwid_naa +uses the naa wwid decoded from the vpd_pg83 sysfs file. +.IP \[bu] 2 +.B wwid_eui +uses the eui wwid decoded from the vpd_pg83 sysfs file. +.IP \[bu] 2 +.B wwid_t10 +uses the t10 wwid decoded from the vpd_pg83 sysfs file. .IP \[bu] 2 .B sys_serial -uses the serial number reported by sysfs. This is the second choice for -non-virtual devices. +uses the serial number reported by the serial sysfs file or the vpd_pg80 +file. A serial number is used if no wwid is available. .IP \[bu] 2 .B mpath_uuid is used for dm multipath devices, reported by sysfs. @@ -164,11 +172,27 @@ is used for loop devices, the backing file name repored by sysfs. .B devname the device name is used if no other type applies. .P - The default choice for device ID type can be overridden using lvmdevices --addev --deviceidtype . If the specified type is available for the device it will be used, otherwise the device will be added using the type that would otherwise be chosen. + +.SS Device ID refresh +.P +A machine identifier is saved in the devices file, and is used to detect +when the devices file has been created by a different machine. If the +devices file was created by a different machine, it indicates that PVs may +have been copied or restored onto new devices on a new machine. In this +case, lvm will search for the PVs listed in system.devices on new devices. +If found, the device IDs will be updated in system.devices for the +existing PVIDs (assuming the original device IDs are also no longer +found.) +.P +The machine identifier used in system.devices will be either the DMI +product_uuid from /sys/devices/virtual/dmi/id/product_uuid, or the +hostname from uname(2). See lvm.conf device_ids_refresh_checks to +configure this. + . .SH USAGE .