Hide Forgot
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:
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.