Bug 1375785

Summary: wipefs -n masks some things that will be wiped when -n is not used
Product: [Fedora] Fedora Reporter: Chris Murphy <bugzilla>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: jonathan, kzak
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-14 08:53:43 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:

Description Chris Murphy 2016-09-14 04:11:44 UTC
Description of problem:

The -n flag is hiding the erasure of signatures that will actually be erased when -n is not used.

Version-Release number of selected component (if applicable):
util-linux-2.28.1-1.fc24.x86_64


How reproducible:
Not sure, always with this particular example.

Steps to Reproduce:
1. wipefs -an
2. wipefs -a
3.

Actual results:

[root@f24m ~]# wipefs -an /dev/sdb
/dev/sdb: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sdb: calling ioctl to re-read partition table: Success
[root@f24m ~]# wipefs -a /dev/sdb
/dev/sdb: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sdb: 8 bytes were erased at offset 0x3ba7ffe00 (gpt): 45 46 49 20 50 41 52 54
/dev/sdb: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
/dev/sdb: calling ioctl to re-read partition table: Success
[root@f24m ~]# 



Expected results:

I expect the -an results to match the 2nd results (without -n). It's a surprise to see -an say only the primary GPT will be wiped, but then without -n it ends up wiping the primary and backup GPT, and the PMBR.




Additional info:

Comment 1 Karel Zak 2016-09-14 08:53:43 UTC
This is unfortunately impossible with libblkid. 

The wipefs re-reads the disk after erase and then it detects another superblock or magic string etc. The heuristic often depends on stuff stored on the disk and if something is missing (due to erase) then another way is used, etc.

It's impossible (or too complex) support all permutations in one step. Sorry.