Red Hat Bugzilla – Bug 1022217
fdisk mishandles GPT corruption
Last modified: 2013-11-10 03:13:46 EST
Description of problem: When the primary GPT is corrupt and the backup GPT is valid, fdisk incorrectly considers the disklabel to be dos (MBR). When either primary or backup GPT is corrupt, fdisk incorrectly doesn't inform the user, and doesn't enable restoration of the invalid GPT with information from the valid one.
Marking this bug as urgent because the entire point of having two GPTs is precisely to avoid the problem described in this bug.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Use parted or gdisk to create a GPT partitioned disk.
2. Use dd to modify LBA 2.
3. Try to edit the disk with fdisk.
fdisk reports the disk label type is dos.
fdisk is required by the UEFI spec to use the valid GPT and restore the invalid GPT (using the correct information in the valid GPT).
Further, if LBA -33 is modified instead in step 2 above; fdisk correctly considers the disk gpt, but incorrectly fails to inform the user that the backup GPT is corrupt and offers no obvious means of restoring it.
Try to edit the disk with either parted or gdisk. They will notify which GPT is corrupt, and that the other is being used instead, and upon write will restore the invalid GPT.
Fixed by upstream commit d2d9efa103a744363bd000e075435341c5256c8a. Fedora package will be updated ASAP.
.. and commit upstream commit 45ddb828ed7eef92db34841c9d583047b6a6c65e.
util-linux-2.24-1.fc20 has been submitted as an update for Fedora 20.
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing util-linux-2.24-1.fc20'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Separately zero'd LBA 2 and LBA -33. fdisk, like gdisk and parted, complains about corruption of the proper GPT, and upon writing out existing the problem is fixed.
Repeated the test with a one byte change to the partitiontypeGUID of the first partition. Same results, fdisk catches the corruption in the proper GPT and fixes either one.
Bug appears to be fixed.
util-linux-2.24-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.