gpart probing problem

Marcel Moolenaar xcllnt at mac.com
Wed Mar 4 10:11:25 PST 2009


On Mar 4, 2009, at 7:14 AM, Jaakko Heinonen wrote:

>
> Thanks for your reply.
>
> On 2009-03-03, Marcel Moolenaar wrote:
>> There's always a MBR in front of a GPT and a corrupted GPT should not
>> be tossed aside and ignored.
>
> I see the point. However this could cause problems for people moving
> disks between operating systems (as it caused for me) because some
> popular operating systems show MBR partition(s) in this case.

That's a mistake IMO.

> I tested these operating systems:
>
> Mac OS X 10.4
> Linux (Ubuntu kernel 2.6.27-7-generic)
> OpenSolaris (2008.11 release)
> Windows XP/2003
>
>> Under no circumstance should the kernel use the MBR and pretend
>> nothing is wrong.
>
> Is this behaviour defined in the EFI specification? Are the OSes  
> listed
> above buggy and/or do they violate the specification?

The EFI specification has been obsoleted by events
to some extend. For one, the MBR in front of a GPT
was there *only* for backward compatibility with
MBR tools that don't know about GPT. Those tools
would see a disk that's entirely in use rather than
a disk that's unpartitioned. This is not the case
anymore. The MBR now contains valid partitions for
use by OSes that don't know anything about GPT.

However: the key statement there is "OSes that
don't know about GPT". Any OS that knows about GPT
should use the GPT. That, if not explicitly stated
in the EFI specification, is definitely the intend
and is actually current practice: The dual MBR+GPT
setup can only work if GPT-aware OSes use the GPT
and GPT-unaware OSes use the MBR.

A such: if a GPT is found, but corrupted, the OS
should *not* silently use the MBR (it can only
find a GPT if it's a GPT-aware OS). It should use
the GPT if possible (the redundancy has been added
by design so that you can recover from the most
common forms of corruption), or fail if it's
inconsistent to the extend that there's no clear
interpretation (i.e. conflicting/ambiguous).

So yes, the OSes you listed above are buggy. I can't
claim they violate the specification, because the
specification is hardly applicable anymore.

This, of course, is the root cause the problem...

-- 
Marcel Moolenaar
xcllnt at mac.com





More information about the freebsd-geom mailing list