Bug 1353149

Summary: different behaviors of "vgcreate -f" between versions
Product: Red Hat Enterprise Linux 7 Reporter: Boyang Xue <bxue>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Command-line tools QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: agk, eguan, heinzm, jbrassow, msnitzer, prajnoha, prockai, rbednar, teigland, thornber, zkabelac
Version: 7.3Keywords: Regression
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.161-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 04:22:04 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 Boyang Xue 2016-07-06 09:27:24 UTC
Description of problem:

I observed the behavior of vgcreate has changed, which "vgcreate -f"
doesn't mute fs signature wiping confirmation as before.
The different behaviors between on RHEL-7.2 and RHEL-7.3 shows as:

RHEL-7.2:
-----
[root@ibm-p730-05-lp3 ~]# rpm -q lvm2
lvm2-2.02.130.el7.x86_64
[root@ibm-p730-05-lp3 ~]# uname -a
Linux ibm-p730-05-lp3.rhts.eng.bos.redhat.com 3.10.0-327.el7.ppc64 #1
SMP Thu Oct 29 17:33:57 EDT 2015 ppc64 ppc64 ppc64 GNU/Linux

# create test device and create ext4 on it, so it leaves ext4 signature on the device
fallocate -l 128M dummy.img
losetup /dev/loop0 dummy.img
mkfs.ext4 -F /dev/loop0

# create vg on test device with -f option, no prompt for clearing signature
vgcreate -f vgtest /dev/loop0

  Wiping ext4 signature on /dev/loop0.
  Physical volume "/dev/loop0" successfully created
  Volume group "vgtest" successfully created
-----

RHEL-7.3-20160617.n.0
-----
[root@ibm-p8-04-lp8 ~]# rpm -q lvm2
lvm2-2.02.156.el7.x86_64
[root@ibm-p8-04-lp8 ~]# uname -a
Linux ibm-p8-04-lp8.rhts.eng.bos.redhat.com 3.10.0-442.el7.ppc64 #1
SMP Thu Jun 16 18:35:03 EDT 2016 ppc64 ppc64 ppc64 GNU/Linux

# create test device and create ext4 on it, so it leaves ext4 signature on the device
fallocate -l 128M dummy.img
losetup /dev/loop0 dummy.img
mkfs.ext4 -F /dev/loop0

# create vg on test device with -f option, no prompt for clearing signature
vgcreate -f vgtest /dev/loop0

WARNING: ext4 signature detected on /dev/loop0 at offset 1080. Wipe it? [y/n]:
-----

Version-Release number of selected component (if applicable):
2.02.156

How reproducible:
Always

Steps to Reproduce:
refer to "description"

Actual results:
"vgcreate -f" requires wiping confirmation

Expected results:
"vgcreate -f" doesn't require wiping confirmation

Additional info:

Comment 2 David Teigland 2016-07-06 19:14:31 UTC
fixed here
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=4d1c4e1f7339746eacc850f45085ecd75bfd56a1

    vgcreate: allow pvcreate force option
    
    Commit a9940bd3c92 began disallowing the -f (force) option
    to apply to the implicit pvcreate.  Make it allowed again.

Comment 5 Roman Bednář 2016-09-21 12:17:04 UTC
Marking verified with latest rpms. vgcreate -f does not prompt for fs signature wiping anymore.

# vgcreate vg /dev/sda
WARNING: xfs signature detected on /dev/sda at offset 0. Wipe it? [y/n]: n
  Aborted wiping of xfs.
  1 existing signature left on the device.

# vgcreate vg /dev/sda -f
  Wiping xfs signature on /dev/sda.
  Physical volume "/dev/sda" successfully created.
  Volume group "vg" successfully created

# /usr/tests/sts-rhel7.3/
bin/          bonding-ng/   cman/         dm/           gfs/          lib/          lvm2/         nfs/          pcs/          roller/       upgrade/      vedder/       xmlrpc/       
bonding/      clufter/      ctdb/         fence/        gfs2/         logging/      man/          pacemaker/    rgmanager/    scsi_reserve/ var/          virt/         



3.10.0-505.el7.x86_64

lvm2-2.02.165-2.el7    BUILT: Wed Sep 14 16:01:43 CEST 2016
lvm2-libs-2.02.165-2.el7    BUILT: Wed Sep 14 16:01:43 CEST 2016
lvm2-cluster-2.02.165-2.el7    BUILT: Wed Sep 14 16:01:43 CEST 2016
device-mapper-1.02.134-2.el7    BUILT: Wed Sep 14 16:01:43 CEST 2016
device-mapper-libs-1.02.134-2.el7    BUILT: Wed Sep 14 16:01:43 CEST 2016
device-mapper-event-1.02.134-2.el7    BUILT: Wed Sep 14 16:01:43 CEST 2016
device-mapper-event-libs-1.02.134-2.el7    BUILT: Wed Sep 14 16:01:43 CEST 2016
device-mapper-persistent-data-0.6.3-1.el7    BUILT: Fri Jul 22 12:29:13 CEST 2016
cmirror-2.02.165-2.el7    BUILT: Wed Sep 14 16:01:43 CEST 2016

Comment 7 errata-xmlrpc 2016-11-04 04:22:04 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