parted rejects GPT as corrupt, kernel + gdisk think it's ok

Bug #1187560 reported by Steve Langasek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
parted (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

parted rejects the GPT on my N4 as invalid:

# parted /dev/mmcblk0
GNU Parted 2.3
Using /dev/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Error: Both the primary and backup GPT tables are corrupt. Try making a fresh
table, and using Parted's rescue feature to recover partitions.

but the kernel has no problem with this table, and gdisk also works with it just fine. The backup table *is* corrupt, everyone agrees - but the primary seems to be valid from the kernel's POV, so parted ought to read it.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: parted 2.3-13ubuntu1
ProcVersionSignature: Ubuntu 3.9.0-3.8-generic 3.9.4
Uname: Linux 3.9.0-3-generic x86_64
ApportVersion: 2.10.2-0ubuntu1
Architecture: amd64
Date: Tue Jun 4 13:54:22 2013
InstallationDate: Installed on 2010-09-24 (984 days ago)
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
MarkForUpload: True
SourcePackage: parted
UpgradeStatus: Upgraded to saucy on 2013-05-06 (28 days ago)

Revision history for this message
Steve Langasek (vorlon) wrote :
Revision history for this message
Steve Langasek (vorlon) wrote :
Revision history for this message
Phillip Susi (psusi) wrote :

The first 16KiB does not cover the whole partition table; it's 2 sectors longer than that for the pbmr and the primary header.

Changed in parted (Ubuntu):
status: New → Incomplete
Revision history for this message
Steve Langasek (vorlon) wrote :

Ok, attaching the first 32k instead (that should be enough, right?)

Changed in parted (Ubuntu):
status: Incomplete → New
Revision history for this message
Phillip Susi (psusi) wrote :

It looks like your partition table has an unusually small number of entries instead of the standard 128, and this is confusing the old parted we're using. This was fixed some time ago upstream.

Changed in parted (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Colin Watson (cjwatson) wrote :

My gdb session doesn't seem to agree; it thinks that the CRC32 doesn't match. Phillip, can you provide a more detailed reference for your investigation, in case I've missed something?

Revision history for this message
Colin Watson (cjwatson) wrote :

(It's possible I've screwed something up by the way I slammed Steve's file into a fake device so that I could play with it ...)

Revision history for this message
Phillip Susi (psusi) wrote :

It thinks the crc doesn't match because it still runs the crc on 128 entries even though this table does not have that many. Basically, it initializes the count of entries to 128, and doesn't update it from the value in the header until *after* it checks the crc of the entries.

Phillip Susi (psusi)
Changed in parted (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Phillip Susi (psusi)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package parted - 2.3-13ubuntu2

---------------
parted (2.3-13ubuntu2) saucy; urgency=low

  * Remove tests/Makefile.in from debian/patches/gptsync.patch; this must
    not be present now that we're using dh-autoreconf.
  * Backport upstream patches to handle GPT labels with fewer than 128
    partition entries (LP: #1187560).
 -- Colin Watson <email address hidden> Mon, 17 Jun 2013 18:42:45 +0100

Changed in parted (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Phillip Susi (psusi) wrote :

Looks like Collin and I were fixing this at the same time. I'll use his version then and resubmit my merge proposal for debian.

Changed in parted (Ubuntu):
assignee: Phillip Susi (psusi) → nobody
status: Fix Released → Triaged
Steve Langasek (vorlon)
Changed in parted (Ubuntu):
status: Triaged → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.