Bug 887971

Summary: pvcreate fails if partition contains a swap signature
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: dyasny, mbooth
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-17 19:55:49 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 Richard W.M. Jones 2012-12-17 17:38:02 UTC
Description of problem:

$ guestfish -N part mkswap /dev/sda1 : pvcreate /dev/sda1
libguestfs: error: pvcreate: WARNING: swap signature detected on /dev/sda1. Wipe it? [y/n] 
  Aborting pvcreate on /dev/sda1.

But note that other content is fine.  For example if the
partition contained an ext2 filesystem before, then pvcreate works:

$ guestfish -N part mkfs ext2 /dev/sda1 : pvcreate /dev/sda1
[no error]

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

libguestfs 1.20.0

How reproducible:

100%

Steps to Reproduce:
See above.

Additional information:

For some reason this especially affects the test suite under
RHEL 7.  It may be that a combination of tests has been disabled,
such that when we come to test pvcreate there happens to be
a swap space signature on the partition.

Comment 1 Richard W.M. Jones 2012-12-17 19:55:49 UTC
Fixed upstream in:
https://github.com/libguestfs/libguestfs/commit/8237ac89c5b51490f3f3c6f44d35ecaa184dca05

Comment 2 Richard W.M. Jones 2012-12-21 09:16:29 UTC
With 1.20.1-2 package, this works.