Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9756824f6447fb8c60967…
Commit: 9756824f6447fb8c6096760e802d4f616929f710
Parent: 46fe47b8e0ad8069bb3736d2aa3e78befdccb38d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 23 11:39:46 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:08:10 2023 +0200
make: generate
---
conf/example.conf.in | 28 +++++++++++++++++++++++++++-
man/lvcreate.8_pregen | 6 ++++++
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 0b9b06a17..35837c013 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -1201,7 +1201,7 @@ global {
# Configuration option global/thin_check_executable.
# The full path to the thin_check command.
- # LVM uses this command to check that a thin metadata device is in a
+ # LVM uses this command to check that a thin pool metadata device is in a
# usable state. When a thin pool is activated and after it is
# deactivated, this command is run. Activation will only proceed if
# the command has an exit status of 0. Set to "" to skip this check.
@@ -1225,6 +1225,14 @@ global {
# This configuration option has an automatic default value.
# thin_repair_executable = "@THIN_REPAIR_CMD@"
+ # Configuration option global/thin_restore_executable.
+ # The full path to the thin_restore command.
+ # LVM uses this command to restore generated data for a thin pool metadata device.
+ # Also see thin_restore_options.
+ # (See package device-mapper-persistent-data or thin-provisioning-tools)
+ # This configuration option has an automatic default value.
+ # thin_restore_executable = "@THIN_RESTORE_CMD@"
+
# Configuration option global/thin_check_options.
# List of options passed to the thin_check command.
# With thin_check version 2.1 or newer you can add the option
@@ -1239,6 +1247,11 @@ global {
# This configuration option has an automatic default value.
# thin_repair_options = [ "" ]
+ # Configuration option global/thin_restore_options.
+ # List of options passed to the thin_restore command.
+ # This configuration option has an automatic default value.
+ # thin_restore_options = [ "" ]
+
# Configuration option global/thin_disabled_features.
# Features to not use in the thin driver.
# This can be helpful for testing, or to avoid using a feature that is
@@ -1287,6 +1300,14 @@ global {
# This configuration option has an automatic default value.
# cache_repair_executable = "@CACHE_REPAIR_CMD@"
+ # Configuration option global/cache_restore_executable.
+ # The full path to the cache_restore command.
+ # LVM uses this command to restore generated data for a cache metadata device.
+ # Also see cache_restore_options.
+ # (See package device-mapper-persistent-data or thin-provisioning-tools)
+ # This configuration option has an automatic default value.
+ # cache_restore_executable = "@CACHE_RESTORE_CMD@"
+
# Configuration option global/cache_check_options.
# List of options passed to the cache_check command.
# With cache_check version 5.0 or newer you should include the option
@@ -1299,6 +1320,11 @@ global {
# This configuration option has an automatic default value.
# cache_repair_options = [ "" ]
+ # Configuration option global/cache_restore_options.
+ # List of options passed to the cache_restore command.
+ # This configuration option has an automatic default value.
+ # cache_restore_options = [ "" ]
+
# Configuration option global/vdo_format_executable.
# The full path to the vdoformat command.
# LVM uses this command to initial data volume for VDO type logical volume
diff --git a/man/lvcreate.8_pregen b/man/lvcreate.8_pregen
index 528a9db9c..27a93d890 100644
--- a/man/lvcreate.8_pregen
+++ b/man/lvcreate.8_pregen
@@ -491,6 +491,8 @@ Create a thin LV that is a snapshot of an existing thin LV.
[ \fB--type thin\fP ] (implied)
.br
.br
+[ \fB-T\fP|\fB--thin\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
@@ -1917,6 +1919,8 @@ Create a thin LV that is a snapshot of an existing thin LV.
.ad l
[ \fB-T\fP|\fB--thin\fP ]
.br
+[ \fB-s\fP|\fB--snapshot\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
@@ -1937,6 +1941,8 @@ Create a thin LV that is a snapshot of an existing thin LV.
[ \fB--type thin\fP ] (implied)
.br
.br
+[ \fB-s\fP|\fB--snapshot\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fec3087eefc752036a40d…
Commit: fec3087eefc752036a40d854c373132d25ffd30f
Parent: 8d09124c6204d49f6bda833229c96e8a76665127
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 23 14:39:44 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:06:22 2023 +0200
thin: add cfg support for thin_restore and cache_restore
Add configurable paths for thin_restore and cache_restore.
---
lib/config/config_settings.h | 20 +++++++++++++++++++-
lib/config/defaults.h | 4 ++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 2d6d957af..51e11857e 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -1177,7 +1177,7 @@ cfg(global_lvmlockctl_kill_command_CFG, "lvmlockctl_kill_command", global_CFG_SE
cfg(global_thin_check_executable_CFG, "thin_check_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, THIN_CHECK_CMD, vsn(2, 2, 94), "@THIN_CHECK_CMD@", 0, NULL,
"The full path to the thin_check command.\n"
- "LVM uses this command to check that a thin metadata device is in a\n"
+ "LVM uses this command to check that a thin pool metadata device is in a\n"
"usable state. When a thin pool is activated and after it is\n"
"deactivated, this command is run. Activation will only proceed if\n"
"the command has an exit status of 0. Set to \"\" to skip this check.\n"
@@ -1195,6 +1195,12 @@ cfg(global_thin_repair_executable_CFG, "thin_repair_executable", global_CFG_SECT
"an unusable state. Also see thin_repair_options.\n"
"(See package device-mapper-persistent-data or thin-provisioning-tools)\n")
+cfg(global_thin_restore_executable_CFG, "thin_restore_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, THIN_RESTORE_CMD, vsn(2, 3, 22), "@THIN_RESTORE_CMD@", 0, NULL,
+ "The full path to the thin_restore command.\n"
+ "LVM uses this command to restore generated data for a thin pool metadata device.\n"
+ "Also see thin_restore_options.\n"
+ "(See package device-mapper-persistent-data or thin-provisioning-tools)\n")
+
cfg_array(global_thin_check_options_CFG, "thin_check_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_THIN_CHECK_OPTIONS_CONFIG, vsn(2, 2, 96), NULL, 0, NULL,
"List of options passed to the thin_check command.\n"
"With thin_check version 2.1 or newer you can add the option\n"
@@ -1205,6 +1211,9 @@ cfg_array(global_thin_check_options_CFG, "thin_check_options", global_CFG_SECTIO
cfg_array(global_thin_repair_options_CFG, "thin_repair_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_THIN_REPAIR_OPTIONS_CONFIG, vsn(2, 2, 100), NULL, 0, NULL,
"List of options passed to the thin_repair command.\n")
+cfg_array(global_thin_restore_options_CFG, "thin_restore_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_THIN_RESTORE_OPTIONS_CONFIG, vsn(2, 3, 22), NULL, 0, NULL,
+ "List of options passed to the thin_restore command.\n")
+
cfg_array(global_thin_disabled_features_CFG, "thin_disabled_features", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 99), NULL, 0, NULL,
"Features to not use in the thin driver.\n"
"This can be helpful for testing, or to avoid using a feature that is\n"
@@ -1245,6 +1254,12 @@ cfg(global_cache_repair_executable_CFG, "cache_repair_executable", global_CFG_SE
"an unusable state. Also see cache_repair_options.\n"
"(See package device-mapper-persistent-data or thin-provisioning-tools)\n")
+cfg(global_cache_restore_executable_CFG, "cache_restore_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, CACHE_RESTORE_CMD, vsn(2, 3, 22), "@CACHE_RESTORE_CMD@", 0, NULL,
+ "The full path to the cache_restore command.\n"
+ "LVM uses this command to restore generated data for a cache metadata device.\n"
+ "Also see cache_restore_options.\n"
+ "(See package device-mapper-persistent-data or thin-provisioning-tools)\n")
+
cfg_array(global_cache_check_options_CFG, "cache_check_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_CACHE_CHECK_OPTIONS_CONFIG, vsn(2, 2, 108), NULL, 0, NULL,
"List of options passed to the cache_check command.\n"
"With cache_check version 5.0 or newer you should include the option\n"
@@ -1253,6 +1268,9 @@ cfg_array(global_cache_check_options_CFG, "cache_check_options", global_CFG_SECT
cfg_array(global_cache_repair_options_CFG, "cache_repair_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_CACHE_REPAIR_OPTIONS_CONFIG, vsn(2, 2, 108), NULL, 0, NULL,
"List of options passed to the cache_repair command.\n")
+cfg_array(global_cache_restore_options_CFG, "cache_restore_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_CACHE_RESTORE_OPTIONS_CONFIG, vsn(2, 3, 22), NULL, 0, NULL,
+ "List of options passed to the cache_restore command.\n")
+
cfg(global_vdo_format_executable_CFG, "vdo_format_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, VDO_FORMAT_CMD, VDO_1ST_VSN, "@VDO_FORMAT_CMD@", 0, NULL,
"The full path to the vdoformat command.\n"
"LVM uses this command to initial data volume for VDO type logical volume\n")
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 571054dc4..dd40ff3bf 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -117,6 +117,8 @@
#define DEFAULT_THIN_REPAIR_OPTION1 ""
#define DEFAULT_THIN_REPAIR_OPTIONS_CONFIG "#S" DEFAULT_THIN_REPAIR_OPTION1
+#define DEFAULT_THIN_RESTORE_OPTION1 ""
+#define DEFAULT_THIN_RESTORE_OPTIONS_CONFIG "#S" DEFAULT_THIN_RESTORE_OPTION1
#define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
#define DEFAULT_THIN_POOL_CROP_METADATA 0
#define DEFAULT_THIN_POOL_MAX_METADATA_SIZE_V1_KB (UINT64_C(255) * ((1 << 14) - 64) * 4) /* KB */ /* 0x3f8040 blocks */
@@ -145,6 +147,8 @@
#define DEFAULT_CACHE_REPAIR_OPTION1 ""
#define DEFAULT_CACHE_REPAIR_OPTIONS_CONFIG "#S" DEFAULT_CACHE_REPAIR_OPTION1
+#define DEFAULT_CACHE_RESTORE_OPTION1 ""
+#define DEFAULT_CACHE_RESTORE_OPTIONS_CONFIG "#S" DEFAULT_CACHE_RESTORE_OPTION1
#define DEFAULT_CACHE_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
#define DEFAULT_CACHE_POOL_CHUNK_SIZE 64 /* KB */
#define DEFAULT_CACHE_POOL_MAX_CHUNKS 1000000
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=657dde6208ddc8172b7d0…
Commit: 657dde6208ddc8172b7d0e1466751046c8ddaeaa
Parent: ea6b5b694bf0886052b048b2e04b941ec65d90f9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 23 18:01:32 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:05:03 2023 +0200
lvm_import_vdo: correct the converted virtual size
Ensure the volume after conversion has the properly aligned size to the
volume group extent size. This would be visible when using virtual size,
that cannot be divided by extent size.
Before the user had to manually adjust the size after conversion to get
access to all data stored on VDO volume.
---
scripts/lvm_import_vdo.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/scripts/lvm_import_vdo.sh b/scripts/lvm_import_vdo.sh
index bae4b52d1..13197c6fb 100755
--- a/scripts/lvm_import_vdo.sh
+++ b/scripts/lvm_import_vdo.sh
@@ -357,6 +357,7 @@ convert_lv_() {
# For best use the latest version of vdoprepareforlvm tool is required.
convert_non_lv_() {
local vdo_logicalSize=$1
+ local vdo_logicalSizeRounded
local extent_size
local output
local pvfree
@@ -417,7 +418,7 @@ convert_non_lv_() {
# Round virtual size to the LOWER size expressed in extent units.
# lvm is parsing VDO metadata and can read real full size and use it instead of this smaller value.
# To precisely byte-synchronize the size of VDO LV, user can lvresize such VDO LV later.
- vdo_logicalSize=$(( ( vdo_logicalSize / extent_size ) * extent_size ))
+ vdo_logicalSizeRounded=$(( ( vdo_logicalSize / extent_size ) * extent_size ))
verbose "Creating VG \"${NAME%/*}\" with extent size $extent_size KiB."
dry "$LVM" vgcreate $YES $VERB --devices "$devices" -s "${extent_size}k" "$VGNAME" "$devices" || {
@@ -428,7 +429,12 @@ convert_non_lv_() {
dry "$LVM" lvcreate -Zn -Wn -an $YES $VERB --devices "$devices" -l100%VG -n "${LVNAME}_vpool" "$VGNAME" "$devices"
verbose "Converting to VDO pool."
- dry "$LVM" lvconvert $YES $VERB $FORCE --devices "$devices" --config "$VDO_ALLOCATION_PARAMS" -Zn -V "${vdo_logicalSize}k" -n "$LVNAME" --type vdo-pool "$VGNAME/${LVNAME}_vpool"
+ dry "$LVM" lvconvert $YES $VERB $FORCE --devices "$devices" --config "$VDO_ALLOCATION_PARAMS" -Zn -V "${vdo_logicalSizeRounded}k" -n "$LVNAME" --type vdo-pool "$VGNAME/${LVNAME}_vpool"
+ if [ "$vdo_logicalSizeRounded" -lt "$vdo_logicalSize" ] ; then
+ # need to extend virtal size to be covering all the converted area
+ # let lvm2 to round to the proper virtual size of VDO LV
+ dry "$LVM" lvextend $YES $VERB --fs ignore --devices "$devices" -L "$vdo_logicalSize"k "$VGNAME/$LVNAME"
+ fi
dry "$LVM" vgchange -an $VERB $FORCE --devices "$devices" "$VGNAME"