Skip to contentSkip to conversation

lvcreate: support --force option

PATCH New Lidong Zhong 2 participants 7 messages Oct 10, 2015 – Oct 27, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lvcreate: support --force option

The option is supported in the logic of lvcreate but is omitted in commands.h.

---
 WHATS_NEW        | 1 +
 tools/commands.h | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
WHATS_NEW +1 -0
index 9af759e..274af43 100644
@@ -1,5 +1,6 @@
 Version 2.02.133 - 
 ======================================
+  Make lvcreate support --force option
   Cleanup vgimportclone script and remove dependency on awk, grep, cut and tr.
   Add vg_missing_pv_count report field to report number of missing PVs in a VG.
   Properly identify internal LV holding sanlock locks within lv_role field.
tools/commands.h +3 -1
index 92d13fd..7695498 100644
@@ -311,6 +311,7 @@ xx(lvcreate,
    "\t[-C|--contiguous {y|n}]\n"
    "\t[--commandprofile ProfileName]\n"
    "\t[-d|--debug]\n"
+   "\t[-f|--force]\n"
    "\t[-h|-?|--help]\n"
    "\t[--errorwhenfull {y|n}]\n"
    "\t[--ignoremonitoring]\n"
@@ -360,6 +361,7 @@ xx(lvcreate,
    "\t[--commandprofile ProfileName]\n"
    "\t[-d|--debug]\n"
    "\t[--discards {ignore|nopassdown|passdown}]\n"
+   "\t[-f|--force]\n"
    "\t[-h|-?|--help]\n"
    "\t[--ignoremonitoring]\n"
    "\t[--monitor {y|n}]\n"
@@ -386,7 +388,7 @@ xx(lvcreate,
    addtag_ARG, alloc_ARG, autobackup_ARG, activate_ARG, available_ARG,
    cache_ARG, cachemode_ARG, cachepool_ARG, cachepolicy_ARG, cachesettings_ARG,
    chunksize_ARG, contiguous_ARG, corelog_ARG, discards_ARG, errorwhenfull_ARG,
-   extents_ARG, ignoreactivationskip_ARG, ignoremonitoring_ARG, major_ARG,
+   extents_ARG, force_ARG, ignoreactivationskip_ARG, ignoremonitoring_ARG, major_ARG,
    metadataprofile_ARG, minor_ARG, mirrorlog_ARG, mirrors_ARG, monitor_ARG,
    minrecoveryrate_ARG, maxrecoveryrate_ARG, name_ARG, nosync_ARG,
    noudevsync_ARG, permission_ARG, persistent_ARG,
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 lvcreate: support --force option

Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):

Quoted 3 lines

The option is supported in the logic of lvcreate but is omitted in commands.h.

Nope - it's not intended to be unsupported so far.

We do support --yes to overcome prompts.

Normally --force is meant to be used on paths to proceed with i.e. lvremove, lvconvert

Do you have any case in mind where '--force' with lvcreate would have make any sense ?
IMHO creating something with --force looks to me like crazy idea to start with
- but maybe there is some use-case I'm missing ?

Zdenek

#2 lore raw

PATCH 1/1 lvcreate: support --force option

Hi Zdenek,

Thanks for your reply.

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 10/10/2015 at 09:17 PM, in message <[email protected]>, Zdenek

Quoted 7 lines · Kabelac

Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):

Quoted 3 lines

The option is supported in the logic of lvcreate but is omitted in commands.h.

Nope - it's not intended to be unsupported so far.

Quoted 8 lines

We do support --yes to overcome prompts.

Normally --force is meant to be used on paths to proceed with i.e. lvremove, lvconvert

Do you have any case in mind where '--force' with lvcreate would have make any

sense ?

Not really. I met this problem when I was using lvcreate with the --wipesignature option. --yes works for me. But I also found that --force should also work when I read the source. However, it reports -f/--force is an invalid option for lvcreate.

Quoted 4 lines

IMHO creating something with --force looks to me like crazy idea to start with

- but maybe there is some use-case I'm missing ?

Currently there is no introduction to --yes in the manpage of lvcreate. How about adding it to the manpage?

Regards,
Lidong

Quoted 8 lines

Zdenek

Signature · 3 lines
lvm-devel mailing list 
lvm-devel at redhat.com 
https://www.redhat.com/mailman/listinfo/lvm-devel 
#3 lore raw

PATCH 1/1 lvcreate: support --force option

Dne 12.10.2015 v 04:26 Lidong Zhong napsal(a):

Quoted 18 lines

Hi Zdenek,

Thanks for your reply.

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 10/10/2015 at 09:17 PM, in message <[email protected]>, Zdenek

Quoted 12 lines · Kabelac

Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):

Quoted 3 lines

The option is supported in the logic of lvcreate but is omitted in commands.h.

Nope - it's not intended to be unsupported so far.

We do support --yes to overcome prompts.

Normally --force is meant to be used on paths to proceed with i.e. lvremove, lvconvert

Quoted 7 lines
Quoted 3 lines

Do you have any case in mind where '--force' with lvcreate would have make any

sense ?

Not really. I met this problem when I was using lvcreate with the --wipesignature option. --yes works for me. But I also found that --force should also work when I read the source. However, it reports -f/--force is an invalid option for lvcreate.

Yep - and so far it should stay that way - --force has special meaning for being quite unsafe operation.

Quoted 8 lines
Quoted 5 lines

IMHO creating something with --force looks to me like crazy idea to start with

- but maybe there is some use-case I'm missing ?

Currently there is no introduction to --yes in the manpage of lvcreate. How about adding it to the manpage?

Every lvm man page references 'man lvm' as the source of description for all 'commonly' accepted options (like --yes).

One day we may switch to 'generated' man pages - where very man page would have all options described - but I guess this 'day' is still pretty far away ;)

Regards

Zdenek

#4 lore raw

PATCH 1/1 lvcreate: support --force option

Hi Zdenek,

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 10/12/2015 at 05:02 PM, in message <[email protected]>, Zdenek

Quoted 19 lines · Kabelac

Dne 12.10.2015 v 04:26 Lidong Zhong napsal(a):

Quoted 18 lines

Hi Zdenek,

Thanks for your reply.

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 10/10/2015 at 09:17 PM, in message <[email protected]>, Zdenek

Quoted 12 lines · Kabelac

Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):

Quoted 3 lines

The option is supported in the logic of lvcreate but is omitted in commands.h.

Nope - it's not intended to be unsupported so far.

We do support --yes to overcome prompts.

Normally --force is meant to be used on paths to proceed with i.e. lvremove, lvconvert

Quoted 7 lines
Quoted 1 line
Quoted 1 line

Do you have any case in mind where '--force' with lvcreate would have make

any

Quoted 4 lines
Quoted 2 lines

sense ?

Not really. I met this problem when I was using lvcreate with the

--wipesignature option.

If we set the --wipesignature to y while creating an lv, there will be a prompt for confirming in current code. Doesn't it make more sense that there shouldn't be the prompt? since we definitely want to remove the signature by setting this option.
Some options such as "--zero=y" don't give prompt, why it is different?
Please give your opinion.

Regards,
Lidong

Quoted 37 lines
Quoted 1 line

--yes works for me. But I also found that --force should also work when I read

the source.

Quoted 1 line

However, it reports -f/--force is an invalid option for lvcreate.

Yep - and so far it should stay that way - --force has special meaning for being quite unsafe operation.

Quoted 2 lines
Quoted 2 lines

IMHO creating something with --force looks to me like crazy idea to start

with

Quoted 5 lines
Quoted 3 lines

- but maybe there is some use-case I'm missing ?

Currently there is no introduction to --yes in the manpage of lvcreate. How

about adding it to

Quoted 1 line

the manpage?

Every lvm man page references 'man lvm' as the source of description for all

'commonly' accepted options (like --yes).

One day we may switch to 'generated' man pages - where very man page would have all options described - but I guess this 'day' is still pretty far away ;)

Regards

Zdenek

Signature · 3 lines
lvm-devel mailing list 
lvm-devel at redhat.com 
https://www.redhat.com/mailman/listinfo/lvm-devel 
#5 lore raw

PATCH 1/1 lvcreate: support --force option

Dne 26.10.2015 v 11:07 Lidong Zhong napsal(a):

Quoted 28 lines

Hi Zdenek,

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 10/12/2015 at 05:02 PM, in message <[email protected]>, Zdenek

Quoted 24 lines · Kabelac

Dne 12.10.2015 v 04:26 Lidong Zhong napsal(a):

Quoted 19 lines

Hi Zdenek,

Thanks for your reply.

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 10/10/2015 at 09:17 PM, in message <[email protected]>, Zdenek

Quoted 13 lines · Kabelac

Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):

Quoted 3 lines

The option is supported in the logic of lvcreate but is omitted in commands.h.

Nope - it's not intended to be unsupported so far.

We do support --yes to overcome prompts.

Normally --force is meant to be used on paths to proceed with i.e. lvremove, lvconvert

Do you have any case in mind where '--force' with lvcreate would have make

any

Quoted 3 lines
Quoted 2 lines

sense ?

Quoted 9 lines
Quoted 2 lines
Quoted 1 line

Not really. I met this problem when I was using lvcreate with the

--wipesignature option.

If we set the --wipesignature to y while creating an lv, there will be a prompt for confirming in current code. Doesn't it make more sense that there shouldn't be the prompt? since we definitely want to remove the signature by setting this option.
Some options such as "--zero=y" don't give prompt, why it is different?
Please give your opinion.

Hi

Here is explanation.

'zero' is unconditional and does not detect any signature - so it has nothing to prompt about - it zeroes first 4K as that's what user asked for.

New 'wipesignature' first detects signature and asks if you want to wipe. That's the API (and it's very similar to e.g. mkfs)

If lvm2 knows its overwriting something it prompts - that's the rule.

If you are going to take a 'risk' for no prompting - use '--yes'

lvm2 is possibly missing couple prompts - so you could possibly open BZ for the case we convert/overwrite something without prompting first.

But existing prompts will remain as they are as they are correct.

Regards

Zdenek

#6 lore raw

PATCH 1/1 lvcreate: support --force option

Hello Zdenek,

Thanks for your detailed explanation. I am clear that it's a rule that it prompt every time when lvm2 overwrites something.
Once there is a exception in future, I surely will notify the upstream. Thanks again.

Regards,
Lidong

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 10/26/2015 at 09:42 PM, in message <[email protected]>, Zdenek

Quoted 69 lines · Kabelac

Dne 26.10.2015 v 11:07 Lidong Zhong napsal(a):

Quoted 24 lines

Hi Zdenek,

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 10/12/2015 at 05:02 PM, in message <[email protected]>, Zdenek

Quoted 20 lines · Kabelac

Dne 12.10.2015 v 04:26 Lidong Zhong napsal(a):

Quoted 19 lines

Hi Zdenek,

Thanks for your reply.

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 10/10/2015 at 09:17 PM, in message <[email protected]>, Zdenek

Quoted 13 lines · Kabelac

Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):

Quoted 3 lines

The option is supported in the logic of lvcreate but is omitted in commands.h.

Nope - it's not intended to be unsupported so far.

We do support --yes to overcome prompts.

Normally --force is meant to be used on paths to proceed with i.e. lvremove, lvconvert

Do you have any case in mind where '--force' with lvcreate would have make

Quoted 8 lines
Quoted 6 lines

any

Quoted 4 lines
Quoted 2 lines

sense ?

Not really. I met this problem when I was using lvcreate with the

--wipesignature option.

If we set the --wipesignature to y while creating an lv, there will be a

prompt for confirming

Quoted 1 line

in current code. Doesn't it make more sense that there shouldn't be the

prompt? since we

Quoted 4 lines

definitely want to remove the signature by setting this option. Some options such as "--zero=y" don't give prompt, why it is different? Please give your opinion.

Hi

Here is explanation.

'zero' is unconditional and does not detect any signature - so it has nothing

to prompt about - it zeroes first 4K as that's what user asked for.

New 'wipesignature' first detects signature and asks if you want to wipe. That's the API (and it's very similar to e.g. mkfs)

If lvm2 knows its overwriting something it prompts - that's the rule.

If you are going to take a 'risk' for no prompting - use '--yes'

lvm2 is possibly missing couple prompts - so you could possibly open BZ for the case we convert/overwrite something without prompting first.

But existing prompts will remain as they are as they are correct.

Regards

Zdenek