Bug 1484406
| Summary: | fdisk printing partition table/label even after clearing disk label with wipefs tool | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | John Pittman <jpittman> |
| Component: | util-linux | Assignee: | Karel Zak <kzak> |
| Status: | CLOSED WONTFIX | QA Contact: | qe-baseos-daemons |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.4 | CC: | ovasik, rskvaril |
| Target Milestone: | rc | Keywords: | FutureFeature |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-06-08 09:21:27 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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1546552 | ||
|
Description
John Pittman
2017-08-23 13:30:45 UTC
It seems fdisk behaviour is correct and expected. There are two tables on the device PMBR and PGT. You have removed GPT by wipefs. The valid PMBR is still on the device and fdisk provides opportunity to use it. Note that "wipefs" from RHEL7 is not smart enough show all magic strings permutations and delete all. Unfortunately, sometimes is necessary to call wipefs more than once if there is more magic strings (more partition tables, backup superblocks, etc.). This disadvantage has been already fixed in Fedore/upstream versions. The change is relatively invasive, so I'm not sure we want to backport it to RHEL7. And note that "wipe -o" really erases only specified offset and nothing more, for example GPT has another table at the and of the device, etc. So, it's more wipefs issue than fdisk issue. Thanks for the explanation Karel. Added "FutureFeature" keyword in the hopes this can be a RFE. Right now, is what I've done the best option to keep fdisk from printing the table? Removing the '55 aa' I mean. Or is there a better way that you know of? Don't use "-o", but specify wanted type by "-a -t <list>". For example: # wipefs -a -t gpt,PMBR /dev/sdc /dev/sdc: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54 /dev/sdc: 8 bytes were erased at offset 0x063ffe00 (gpt): 45 46 49 20 50 41 52 54 /dev/sdc: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa /dev/sdc: calling ioclt to re-read partition table: Success works for me. It removes primary, backup gpt headers and PMBR too. Thanks Karel, that works perfectly. I will update the knowledgebase solution. I suppose the confusion comes from the 'wipefs /dev/sdc' command. It only prints out the one offset, so it would seem there is only the one label to remove. Instead, I would think the command should print all 3 offsets; giving the end user a clearer picture of what is actually on the disk and will need to be removed to completlely wipe. Since the -a works with no problem, it seems wipefs is already aware of the labels and they can just be added to the print? Possibly expected output: [root@host]# wipefs /dev/sdc offset type ------------------------------------------- 0x200 gpt 0x63ffe00 gpt 0x1fe PMBR It's implemented since v2.31 (not released yet) where it returns all available offsets. It would be possible to backport it to RHEL7, but I'd like to test by Fedora first -- it's not trivial change in important libblkid code. Maybe RHEL7.6. Upstream commits: d2b0c6587d729a8e838821cb70d4de18c6969868 92296e9ba2bf95259520fa7537ff8edc2aa9edbc 193d6f27fb37497669ed429e70b19b11f2b6d4fa 2cd417ea71127e5fbaf43e9c27bd2fa86b3c5100 This feature request has not been requested by any customer and all the necessary changes seem too invasive for RHEL7 update. I'm going to close this as WONTFIX and remove dev ACK. All the functionally will be available for RHEL8. |