Bug 1305894

Summary: confusing docs about lvcreate -W
Product: Red Hat Enterprise Linux 7 Reporter: Karel Volný <kvolny>
Component: lvm2Assignee: Peter Rajnoha <prajnoha>
lvm2 sub component: Default / Unclassified QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, msnitzer, prajnoha, prockai, rbednar, zkabelac
Version: 7.2   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.161-1.el7 Doc Type: Bug Fix
Doc Text:
Documentation about lvcreate's -W|--wipesignatures option has been edited to provide clearer explanation about its functionality.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 04:14:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Karel Volný 2016-02-09 14:16:52 UTC
Description of problem:
Trying to use "lvcreate" non-interactively (while writing a test for bug 1301091), I have found that it still asks about wiping the signatures.

This can be worked around by using "--yes" option, however, the manpage part about the "-W" option is a bit confusing. It states that if "-Z" is set (which it says yes by default) then the wiping happens by default. But in reality, the user is asked whether to wipe, which isn't exactly what other programs usually mean when talking about "default action" - more correct would be to say that the default is "to ask" instead of "wiping is done", as it might be skipped if the user interactively answers "n".

IMHO the best would be to change the option logic from boolean to tristate - yes/ask/no. Supplying the common "--yes" isn't the best as it may match anything else (but I don't know what else is relevant to "lvcreate") ... but that's a material for new RFE for the code, not just docs change. Is that worth filing?

The manpage also does not explain what exactly happens when "-W" is set to "n". It says that the option controls wiping, but in reality, after using "-W n", it not just does not wipe the signatures (without asking ...) but it even does not report them, i.e. it looks like it doesn't do the detection neither.

Comment 2 Peter Rajnoha 2016-07-12 13:24:28 UTC
I've edited the man page a bit, so hopefully it's clearer now, pasting full text from lvcreate man page:

 -W|--wipesignatures {y|n}

Controls detection and subsequent wiping of signatures on newly created Logical Volume. There's a prompt for each signature detected to confirm its wiping (unless --yes is used where LVM assumes 'yes' answer for each prompt automatically). If this option is not specified, then by default -W|--wipesignatures y is assumed each time the zeroing is done (-Z|--zero y). This default behaviour can be controlled by allocation/wipe_signatures_when_zeroing_new_lvs setting found in lvm.conf(5).

If blkid wiping is used (allocation/use_blkid_wiping setting in lvm.conf(5)) and LVM2 is compiled with blkid wiping support, then blkid(8) library is used to detect the signatures (use blkid -k command to list the signatures that are recognized). Otherwise, native LVM2 code is used to detect signatures (MD RAID, swap and LUKS signatures are detected only in this case).
Logical volume is not wiped if the read only flag is set.

Upstream commit:
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=d5be748341ec88e35c826b70152bf1e757653a3a

Comment 4 Corey Marthaler 2016-09-14 22:29:25 UTC
Marking verified that was was added in comment #2 does now exist in lvcreate(8).

That said, where did the "Wiping each detected signature must be confirmed" that existed for a fix in bug 1193925 go?



lvcreate(8):

       -W|--wipesignatures {y|n}
              Controls detection and subsequent wiping of signatures on newly created Logical Volume. There's a prompt for each signature detected  to  conâ€
              firm  its wiping (unless --yes is used where LVM assumes 'yes' answer for each prompt automatically). If this option is not specified, then by
              default -W | --wipesignatures y is assumed each time the zeroing is done (-Z |  --zero  y).  This  default  behaviour  can  be  controlled  by
              allocation/wipe_signatures_when_zeroing_new_lvs setting found in lvm.conf(5).
              If  blkid  wiping  is  used (allocation/use_blkid_wiping setting in lvm.conf(5)) and LVM2 is compiled with blkid wiping support, then blkid(8)
              library is used to detect the signatures (use blkid -k command to list the signatures that are recognized).  Otherwise, native  LVM2  code  is
              used to detect signatures (MD RAID, swap and LUKS signatures are detected only in this case).
              Logical volume is not wiped if the read only flag is set.

Comment 5 Corey Marthaler 2016-09-14 22:35:05 UTC
FYI - verified in lvm2-2.02.165-2.el7. 

"Wiping each detected signature must be confirmed" is still in lvm.conf. Never mind the mention of it missing in comment #4.

Comment 7 errata-xmlrpc 2016-11-04 04:14:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-1445.html