Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
I'm creating this BZ to not forget to clean this up for 6.5. The --force and --yes args use in LVM commands needs auditing. We should check whether the args are of any use for an LVM command (mainly the --yes arg). And if it has no use there, the arg should not be silently taken and an error/warning message should be present instead that says that the command does not accept such an arg. Also make sure the man page is consistent.
Or the other way around: always accept -y and -f with all commands, including ones where they do nothing, to make scripting/testing simpler. And consider an arg to suppress all prompts - something the external library requires.
The fix here is going to be as mentioned in comment #1. Actually, Alasdair has already committed a patch that makes the --yes arg global:
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=c6cf2ed7fd29d1860df511ac897367af646a6fb3
Now, the same for --force arg will follow + documentation check. This is really just a cleanup to make things more consistent and easier to use so one does not need to put extra conditionals when scripting.
As for suppressing all prompts - I think that should be possible already, but I need to check... if it's not possible yet, then yes, we need to cover this as well!.
We don't specifically cover the general use of -f and -y in the LVM manual, but this might be worth mentioning. I'm cloning this as a doc bug for further consideration.
The --yes is not accepted as a prompt reply for lvreduce
[root@virt-011 ~]# lvreduce --yes -L1G vg/new
WARNING: Reducing active logical volume to 1.00 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce new? [y/n]:
[root@virt-011 ~]# lvreduce -y -L1G vg/new
WARNING: Reducing active logical volume to 1.00 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce new? [y/n]:
Additional one which does not take --yes into account:
[root@virt-011 ~]# vgremove --yes vg
Do you really want to remove volume group "vg" containing 1 logical volumes? [y/n]:
I believe this bug is in principal resolved. However there could remain left piece in the code which needs some more care.
It's then probably better to open individual bug reports for those discovered missing parts.
Logic behind is -
Old commands like 'lvremove -ff/vgremove -ff' will remain intact - we would have broken way too many scripts to require --yes there.
New commands accept '--yes' to go through prompt,
and using '--force' just enables more 'dangerous' code path which may add more prompts.
So newer command basically require to use --yes --force to go without prompts.
Use double --force may enable even more 'dangerous' prompts - but still --yes is needed.
To skip any prompt with 'no' - use -qq.
(In reply to Peter Rajnoha from comment #3)
> The fix here is going to be as mentioned in comment #1. Actually, Alasdair
> has already committed a patch that makes the --yes arg global:
>
> https://git.fedorahosted.org/cgit/lvm2.git/commit/
> ?id=c6cf2ed7fd29d1860df511ac897367af646a6fb3
>
> Now, the same for --force arg will follow
We have a separate bug for that: bug #1011951, so I'm closing this one as it's already released.