From 70c911b63f5b4293cfeffb4bb2debef8c61965ad Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 4 Jul 2023 23:40:11 +0200 Subject: [PATCH] pool: improve message for data persistance Inform a user that pools using either error or zero LVs are not able to keep any data persistant. --- tools/lvconvert.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 572030c96..519d2b628 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -3278,9 +3278,13 @@ static int _lvconvert_to_pool(struct cmd_context *cmd, if (to_thin) log_warn("WARNING: Converting %s to fully provisioned thin volume.", converted_names); - else if (zero_metadata) - log_warn("THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)"); - else if (to_cachepool) + else if (zero_metadata) { + if (lv_is_error(lv) || lv_is_zero(lv)) + log_warn("WARNING: Volume of \"%s\" segtype cannot store ANY real data!", + first_seg(lv)->segtype->name); + else + log_warn("THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)"); + } else if (to_cachepool) log_warn("WARNING: Using mismatched cache pool metadata MAY DESTROY YOUR DATA!"); if (!arg_count(cmd, yes_ARG) &&