Bug 1375785 - wipefs -n masks some things that will be wiped when -n is not used
Summary: wipefs -n masks some things that will be wiped when -n is not used
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-14 04:11 UTC by Chris Murphy
Modified: 2016-09-14 08:53 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-14 08:53:43 UTC
Type: Bug


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.