Quantcast

another gpt vs mbr (sanity) check

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

another gpt vs mbr (sanity) check

Andriy Gapon-3

Please consider the following scenario:
- GPT scheme is used on a disk
- the disk changes hands
- the disk is repartitioned with MBR without explicitly wiping out any of old
data and thus GPT
- GPT data survives undamaged

So now we have the valid GPT but it points to wrong offsets and we have the
valid and correct MBR.
Currently FreeBSD would pick GPT scheme over MBR scheme when presented which
such a disk.  I think that this is incorrect.
I believe that our code should check if MBR is indeed a protective MBR when
deciding whether to use GPT.

Below is a simplistic patch that adds such a check.
Ideally it should probably check the whole MBR partition table instead of just a
type of the first entry.

What do you think?

--- a/sys/geom/part/g_part_gpt.c
+++ b/sys/geom/part/g_part_gpt.c
@@ -568,7 +568,7 @@ g_part_gpt_probe
 {
  struct g_provider *pp;
  char *buf;
- int error, res;
+ int error, res, typ;

  /* We don't nest, which means that our depth should be 0. */
  if (table->gpt_depth != 0)
@@ -598,10 +598,12 @@ g_part_gpt_probe
  if (buf == NULL)
  return (error);
  res = le16dec(buf + DOSMAGICOFFSET);
+ typ = *(unsigned char*)(buf + DOSPARTOFF + 0 * DOSPARTSIZE + 4);
  g_free(buf);
  if (res != DOSMAGIC)
  return (ENXIO);
-
+ if (typ != DOSPTYP_PMBR)
+ return (ENXIO);
  /* Check that there's a primary header. */
  buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error);
  if (buf == NULL)

--
Andriy Gapon
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Marcel Moolenaar-4

On Mar 7, 2010, at 3:10 AM, Andriy Gapon wrote:


>
> Please consider the following scenario:
> - GPT scheme is used on a disk
> - the disk changes hands
> - the disk is repartitioned with MBR without explicitly wiping out any of old
> data and thus GPT
> - GPT data survives undamaged
>
> So now we have the valid GPT but it points to wrong offsets and we have the
> valid and correct MBR.
> Currently FreeBSD would pick GPT scheme over MBR scheme when presented which
> such a disk.  I think that this is incorrect.

Sorry. That ship has sailed. Originally GEOM_GPT at the time checked
for the protective MBR before accepting the GPT. This was changed to
support Apple setups. There's no turning back now. People just need
to learn to wipe out old partitioning information before writing
select sectors in order to create a new one.

This, BTW, is exactly why gpart was designed the way it was. It makes
sure that you properly clean all the meta-data of the  old scheme
before new meta-data is written. Legacy tools like fdisk and bsdlabel
only write their meta-data without any consideration of the possible
existence of meta-data corresponding to other schemes.

Now that I think of it, it wouldn't necessarily be a bad feature to
extend gpart with a verb, like "wipe", that calls G_PART_DESTROY()
for all the schemes it knows about and then erases all the sectors
in the sector map, wiping out any and all meta-data that gpart could
ever interpret (with the caveat that this is limited to the schemes
the kernel knows about at the time).

--
Marcel Moolenaar
[hidden email]



_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Andriy Gapon-3
on 07/03/2010 21:13 Marcel Moolenaar said the following:

> On Mar 7, 2010, at 3:10 AM, Andriy Gapon wrote:
>
>
>> Please consider the following scenario:
>> - GPT scheme is used on a disk
>> - the disk changes hands
>> - the disk is repartitioned with MBR without explicitly wiping out any of old
>> data and thus GPT
>> - GPT data survives undamaged
>>
>> So now we have the valid GPT but it points to wrong offsets and we have the
>> valid and correct MBR.
>> Currently FreeBSD would pick GPT scheme over MBR scheme when presented which
>> such a disk.  I think that this is incorrect.
>
> Sorry. That ship has sailed. Originally GEOM_GPT at the time checked
> for the protective MBR before accepting the GPT. This was changed to
> support Apple setups. There's no turning back now. People just need
> to learn to wipe out old partitioning information before writing
> select sectors in order to create a new one.

Hmm, I probably wasn't there when the ship was sailing out :)
What is the 'Apple setup'?  Is it a some sort of a hybrid scheme?  Don't they
still use a protective type for the first partition in MBR?
Can we perhaps have the best of all words and do some smart autodetection?
Or, at least, have some manual lever to control such things?

When a friend gives me his SDHC card to copy some files out of it, he wouldn't
want me to perform some non-readonly magic with it and he wouldn't bother to
listen my explanations because the card works nice for him with Windows.

--
Andriy Gapon
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Marcel Moolenaar-4

On Mar 7, 2010, at 11:35 AM, Andriy Gapon wrote:

> on 07/03/2010 21:13 Marcel Moolenaar said the following:
>> On Mar 7, 2010, at 3:10 AM, Andriy Gapon wrote:
>>
>>
>>> Please consider the following scenario:
>>> - GPT scheme is used on a disk
>>> - the disk changes hands
>>> - the disk is repartitioned with MBR without explicitly wiping out any of old
>>> data and thus GPT
>>> - GPT data survives undamaged
>>>
>>> So now we have the valid GPT but it points to wrong offsets and we have the
>>> valid and correct MBR.
>>> Currently FreeBSD would pick GPT scheme over MBR scheme when presented which
>>> such a disk.  I think that this is incorrect.
>>
>> Sorry. That ship has sailed. Originally GEOM_GPT at the time checked
>> for the protective MBR before accepting the GPT. This was changed to
>> support Apple setups. There's no turning back now. People just need
>> to learn to wipe out old partitioning information before writing
>> select sectors in order to create a new one.
>
> Hmm, I probably wasn't there when the ship was sailing out :)
> What is the 'Apple setup'?  Is it a some sort of a hybrid scheme?  Don't they
> still use a protective type for the first partition in MBR?

It's a hybrid setup. I can't recall if there's a slice of type 0xEE
or not in all cases, but we stopped checking for that...

> Can we perhaps have the best of all words and do some smart autodetection?
> Or, at least, have some manual lever to control such things?

The best of all worlds doesn't exist anymore. It was how it
was designed to be and not how it's used at this time.

--
Marcel Moolenaar
[hidden email]



_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Andriy Gapon-3
on 08/03/2010 01:31 Marcel Moolenaar said the following:
>
> The best of all worlds doesn't exist anymore. It was how it
> was designed to be and not how it's used at this time.

So, I guess it is carved in stone and there is no point in trying to discuss it.
I'll keep the patch for myself, then.

P.S. Both Windows 7 and OpenSuSE 11.2 handled the disk in question properly from
my point of view, as an MBR disk, only FreeBSD considered it a GPT one.  I have
no access to MacOS.

--
Andriy Gapon
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Marcel Moolenaar-4

On Mar 8, 2010, at 12:43 AM, Andriy Gapon wrote:

> on 08/03/2010 01:31 Marcel Moolenaar said the following:
>>
>> The best of all worlds doesn't exist anymore. It was how it
>> was designed to be and not how it's used at this time.
>
> So, I guess it is carved in stone and there is no point in trying to discuss it.
> I'll keep the patch for myself, then.

I wouldn't call it carved in stone, but I am definitely slamming
the door closed on first attempt. The reason for this is that
to me this is a rehash of something that has gotten a bit of
thought, whereas for the person suggesting the change it's most
likely just an impulse.

If you can find a way that does not violate the "GPT aware OSes
should use the GPT" rule, you'll definitely be listened to.

To clarify: the protective MBR is there only to protect the GPT
disk from tools that do not understand the GPT. Any GPT-aware
tool will treat the disk as a GPT disk. Consequently: the MBR
is inferior to the GPT...

--
Marcel Moolenaar
[hidden email]



_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Pete French-2
> To clarify: the protective MBR is there only to protect the GPT
> disk from tools that do not understand the GPT. Any GPT-aware
> tool will treat the disk as a GPT disk. Consequently: the MBR
> is inferior to the GPT...

The queston is then, why isn't Windows treating it as GPT ? It's
all very nice in theory, but if the practical upshot is that
we get flash media which will read perfectly well in all operating
systems except for BSD then thats not a good result, even if it
is theoretically correct. Which is the situation the original poster
appeared to have.

-pete.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Marcel Moolenaar-4

On Mar 8, 2010, at 9:48 AM, Pete French wrote:

>> To clarify: the protective MBR is there only to protect the GPT
>> disk from tools that do not understand the GPT. Any GPT-aware
>> tool will treat the disk as a GPT disk. Consequently: the MBR
>> is inferior to the GPT...
>
> The queston is then, why isn't Windows treating it as GPT ?

Ask Microsoft. So far I've only seen violations to the spec. At
least Apple kept to the spirit of it...

--
Marcel Moolenaar
[hidden email]



_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Scot Hetzel
In reply to this post by Pete French-2
On Mon, Mar 8, 2010 at 11:48 AM, Pete French
<[hidden email]> wrote:
>> To clarify: the protective MBR is there only to protect the GPT
>> disk from tools that do not understand the GPT. Any GPT-aware
>> tool will treat the disk as a GPT disk. Consequently: the MBR
>> is inferior to the GPT...
>
> The queston is then, why isn't Windows treating it as GPT ? It's

I have both MBR and GPT formated drives installed in my laptop, and
Windows 7 correctly identifies both drives.  The GPT drive was
formated using FreeBSD 8.

> all very nice in theory, but if the practical upshot is that
> we get flash media which will read perfectly well in all operating
> systems except for BSD then thats not a good result, even if it
> is theoretically correct. Which is the situation the original poster
> appeared to have.
>

The problem the original poster was having is this:

Format drive as GPT
Re-Format drive as MBR

FreeBSD still sees the drive as GPT instead of MBR.

The reason is that FreeBSD is still detecting the Seconday GPT which
is located at the end of the disk, and using it due to the Primary GPT
was lost/corrupted when the drive was reformated as MBR disk.

The real question is how was the drive reformated.  If it was
reformated using gpart:

- Delete all existing partitions:
gpart delete -i X adY
- Destroy the GPT formated drive
gpart destroy adY
- Create the MBR formated drive
gpart create -s mbr adY

And the secondary GPT header still exists, then it is a FreeBSD bug.
But if it was reformated using a different tool, then it is a bug in
that tool for not reconizing that the original disk was formated as
GPT.

Scot
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Andriy Gapon-3
In reply to this post by Marcel Moolenaar-4
on 08/03/2010 19:55 Marcel Moolenaar said the following:

> On Mar 8, 2010, at 9:48 AM, Pete French wrote:
>
>>> To clarify: the protective MBR is there only to protect the GPT
>>> disk from tools that do not understand the GPT. Any GPT-aware
>>> tool will treat the disk as a GPT disk. Consequently: the MBR
>>> is inferior to the GPT...
>> The queston is then, why isn't Windows treating it as GPT ?
>
> Ask Microsoft. So far I've only seen violations to the spec. At
> least Apple kept to the spirit of it...

According to my understanding it's the opposite as much as I hate saying this.
My understanding is that valid GPT scheme _must_ provide only a protective MBR,
i.e. MBR where there is only partition and it is of type 0xEE.
That is, any "hybrid MBR" is not a valid GPT scheme.
Google turns up a lot of stuff on this topic.


--
Andriy Gapon
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Marcel Moolenaar-4

On Mar 8, 2010, at 10:35 AM, Andriy Gapon wrote:

> on 08/03/2010 19:55 Marcel Moolenaar said the following:
>> On Mar 8, 2010, at 9:48 AM, Pete French wrote:
>>
>>>> To clarify: the protective MBR is there only to protect the GPT
>>>> disk from tools that do not understand the GPT. Any GPT-aware
>>>> tool will treat the disk as a GPT disk. Consequently: the MBR
>>>> is inferior to the GPT...
>>> The queston is then, why isn't Windows treating it as GPT ?
>>
>> Ask Microsoft. So far I've only seen violations to the spec. At
>> least Apple kept to the spirit of it...
>
> According to my understanding it's the opposite as much as I hate saying this.
> My understanding is that valid GPT scheme _must_ provide only a protective MBR,
> i.e. MBR where there is only partition and it is of type 0xEE.
> That is, any "hybrid MBR" is not a valid GPT scheme.
> Google turns up a lot of stuff on this topic.

Exactly. That is exactly the violation of the spec I was referring
to.

--
Marcel Moolenaar
[hidden email]



_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Scot Hetzel
In reply to this post by Scot Hetzel
On Mon, Mar 8, 2010 at 12:16 PM, Scot Hetzel <[hidden email]> wrote:

> On Mon, Mar 8, 2010 at 11:48 AM, Pete French
> <[hidden email]> wrote:
>>> To clarify: the protective MBR is there only to protect the GPT
>>> disk from tools that do not understand the GPT. Any GPT-aware
>>> tool will treat the disk as a GPT disk. Consequently: the MBR
>>> is inferior to the GPT...
>>
>> The queston is then, why isn't Windows treating it as GPT ? It's
>
> I have both MBR and GPT formated drives installed in my laptop, and
> Windows 7 correctly identifies both drives.  The GPT drive was
> formated using FreeBSD 8.
>
>> all very nice in theory, but if the practical upshot is that
>> we get flash media which will read perfectly well in all operating
>> systems except for BSD then thats not a good result, even if it
>> is theoretically correct. Which is the situation the original poster
>> appeared to have.
>>
>
> The problem the original poster was having is this:
>
> Format drive as GPT
> Re-Format drive as MBR
>
> FreeBSD still sees the drive as GPT instead of MBR.
>
> The reason is that FreeBSD is still detecting the Seconday GPT which
> is located at the end of the disk, and using it due to the Primary GPT
> was lost/corrupted when the drive was reformated as MBR disk.
>
> The real question is how was the drive reformated.  If it was
> reformated using gpart:
>
> - Delete all existing partitions:
> gpart delete -i X adY
> - Destroy the GPT formated drive
> gpart destroy adY
> - Create the MBR formated drive
> gpart create -s mbr adY
>
> And the secondary GPT header still exists, then it is a FreeBSD bug.

I just had a look at the code for sys/geom/part/{g_part.c,
g_part_gpt.c} and it does show that we delete the secondary GPT header
when destroying a GPT formated drive.

> But if it was reformated using a different tool, then it is a bug in
> that tool for not reconizing that the original disk was formated as
> GPT.
>
> Scot
>
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Andriy Gapon-3
In reply to this post by Scot Hetzel
on 08/03/2010 20:16 Scot Hetzel said the following:

> On Mon, Mar 8, 2010 at 11:48 AM, Pete French
> <[hidden email]> wrote:
>>> To clarify: the protective MBR is there only to protect the GPT
>>> disk from tools that do not understand the GPT. Any GPT-aware
>>> tool will treat the disk as a GPT disk. Consequently: the MBR
>>> is inferior to the GPT...
>> The queston is then, why isn't Windows treating it as GPT ? It's
>
> I have both MBR and GPT formated drives installed in my laptop, and
> Windows 7 correctly identifies both drives.  The GPT drive was
> formated using FreeBSD 8.
>
>> all very nice in theory, but if the practical upshot is that
>> we get flash media which will read perfectly well in all operating
>> systems except for BSD then thats not a good result, even if it
>> is theoretically correct. Which is the situation the original poster
>> appeared to have.
>>
>
> The problem the original poster was having is this:
>
> Format drive as GPT
> Re-Format drive as MBR
>
> FreeBSD still sees the drive as GPT instead of MBR.
>
> The reason is that FreeBSD is still detecting the Seconday GPT which
> is located at the end of the disk, and using it due to the Primary GPT
> was lost/corrupted when the drive was reformated as MBR disk.

Not exactly true -  primary GPT (in sector 1) was also intact.
Typical MBR formatting reserves sectors 1-62, but doesn't actually put anything
there.

> The real question is how was the drive reformated.  If it was
> reformated using gpart:
>
> - Delete all existing partitions:
> gpart delete -i X adY
> - Destroy the GPT formated drive
> gpart destroy adY
> - Create the MBR formated drive
> gpart create -s mbr adY
>
> And the secondary GPT header still exists, then it is a FreeBSD bug.
> But if it was reformated using a different tool, then it is a bug in
> that tool for not reconizing that the original disk was formated as
> GPT.

It was formatted either with GPT-unaware tool, which is not a deadly sin (or a
bug), or with a tool that simply ignored anything already on the disk by design.

--
Andriy Gapon
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Andriy Gapon-3
In reply to this post by Marcel Moolenaar-4
on 08/03/2010 20:36 Marcel Moolenaar said the following:

> On Mar 8, 2010, at 10:35 AM, Andriy Gapon wrote:
>
>> on 08/03/2010 19:55 Marcel Moolenaar said the following:
>>> On Mar 8, 2010, at 9:48 AM, Pete French wrote:
>>>> The queston is then, why isn't Windows treating it as GPT ?
>>> Ask Microsoft. So far I've only seen violations to the spec. At
>>> least Apple kept to the spirit of it...
>> According to my understanding it's the opposite as much as I hate saying this.
>> My understanding is that valid GPT scheme _must_ provide only a protective MBR,
>> i.e. MBR where there is only partition and it is of type 0xEE.
>> That is, any "hybrid MBR" is not a valid GPT scheme.
>> Google turns up a lot of stuff on this topic.
>
> Exactly. That is exactly the violation of the spec I was referring
> to.

I am not which part of what I said you meant by 'that'.


--
Andriy Gapon
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Pete French-2
In reply to this post by Scot Hetzel
> The problem the original poster was having is this:
>
> Format drive as GPT
> Re-Format drive as MBR
>
> FreeBSD still sees the drive as GPT instead of MBR.

Actually his *problem* is that FreeBSD sees the drive
a GPT, but other things now see it as MBR. If everything
saw it the same way there would be no issue, regardless
of what the spec says. But if eveyone sees it one way
and we see it another, thats not very useful, even if
it is strictly correct and all the others are wrong.

-pete.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Marcel Moolenaar-4
In reply to this post by Andriy Gapon-3

On Mar 8, 2010, at 10:40 AM, Andriy Gapon wrote:

> on 08/03/2010 20:36 Marcel Moolenaar said the following:
>> On Mar 8, 2010, at 10:35 AM, Andriy Gapon wrote:
>>
>>> on 08/03/2010 19:55 Marcel Moolenaar said the following:
>>>> On Mar 8, 2010, at 9:48 AM, Pete French wrote:
>>>>> The queston is then, why isn't Windows treating it as GPT ?
>>>> Ask Microsoft. So far I've only seen violations to the spec. At
>>>> least Apple kept to the spirit of it...
>>> According to my understanding it's the opposite as much as I hate saying this.
>>> My understanding is that valid GPT scheme _must_ provide only a protective MBR,
>>> i.e. MBR where there is only partition and it is of type 0xEE.
>>> That is, any "hybrid MBR" is not a valid GPT scheme.
>>> Google turns up a lot of stuff on this topic.
>>
>> Exactly. That is exactly the violation of the spec I was referring
>> to.
>
> I am not which part of what I said you meant by 'that'.

All of it.

--
Marcel Moolenaar
[hidden email]



_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Marcel Moolenaar-4
In reply to this post by Pete French-2

On Mar 8, 2010, at 10:52 AM, Pete French wrote:

>> The problem the original poster was having is this:
>>
>> Format drive as GPT
>> Re-Format drive as MBR
>>
>> FreeBSD still sees the drive as GPT instead of MBR.
>
> Actually his *problem* is that FreeBSD sees the drive
> a GPT, but other things now see it as MBR. If everything
> saw it the same way there would be no issue, regardless
> of what the spec says. But if eveyone sees it one way
> and we see it another, thats not very useful, even if
> it is strictly correct and all the others are wrong.

We're already trying to play nice with mainstream OSes.
We've simply reached the point where things ain't simple
anymore and we need to be very careful not to break our
own operating system.

Remember that the PC world has only known about MBR and
whatever people have been doing for 30 years suddenly
isn't enough anymore because there's such a thing as
GPT.

--
Marcel Moolenaar
[hidden email]



_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Andriy Gapon-3
In reply to this post by Marcel Moolenaar-4
on 08/03/2010 22:23 Marcel Moolenaar said the following:

> On Mar 8, 2010, at 10:40 AM, Andriy Gapon wrote:
>
>> on 08/03/2010 20:36 Marcel Moolenaar said the following:
>>> On Mar 8, 2010, at 10:35 AM, Andriy Gapon wrote:
>>>
>>>> on 08/03/2010 19:55 Marcel Moolenaar said the following:
>>>>> On Mar 8, 2010, at 9:48 AM, Pete French wrote:
>>>>>> The queston is then, why isn't Windows treating it as GPT ?
>>>>> Ask Microsoft. So far I've only seen violations to the spec. At
>>>>> least Apple kept to the spirit of it...
>>>> According to my understanding it's the opposite as much as I hate saying this.
>>>> My understanding is that valid GPT scheme _must_ provide only a protective MBR,
>>>> i.e. MBR where there is only partition and it is of type 0xEE.
>>>> That is, any "hybrid MBR" is not a valid GPT scheme.
>>>> Google turns up a lot of stuff on this topic.
>>> Exactly. That is exactly the violation of the spec I was referring
>>> to.
>> I am not which part of what I said you meant by 'that'.
>
> All of it.
This hasn't added any clarity.

So I'll just post one link about what position Apple had (note the past tense)
about protective MBR:
http://developer.apple.com/mac/library/technotes/tn2006/tn2166.html#SECPROTECTIVEMBR

--
Andriy Gapon
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Marcel Moolenaar-4

On Mar 8, 2010, at 12:59 PM, Andriy Gapon wrote:

> on 08/03/2010 22:23 Marcel Moolenaar said the following:
>> On Mar 8, 2010, at 10:40 AM, Andriy Gapon wrote:
>>
>>> on 08/03/2010 20:36 Marcel Moolenaar said the following:
>>>> On Mar 8, 2010, at 10:35 AM, Andriy Gapon wrote:
>>>>
>>>>> on 08/03/2010 19:55 Marcel Moolenaar said the following:
>>>>>> On Mar 8, 2010, at 9:48 AM, Pete French wrote:
>>>>>>> The queston is then, why isn't Windows treating it as GPT ?
>>>>>> Ask Microsoft. So far I've only seen violations to the spec. At
>>>>>> least Apple kept to the spirit of it...
>>>>> According to my understanding it's the opposite as much as I hate saying this.
>>>>> My understanding is that valid GPT scheme _must_ provide only a protective MBR,
>>>>> i.e. MBR where there is only partition and it is of type 0xEE.
>>>>> That is, any "hybrid MBR" is not a valid GPT scheme.
>>>>> Google turns up a lot of stuff on this topic.
>>>> Exactly. That is exactly the violation of the spec I was referring
>>>> to.
>>> I am not which part of what I said you meant by 'that'.
>>
>> All of it.
> This hasn't added any clarity.
>
> So I'll just post one link about what position Apple had (note the past tense)
> about protective MBR:
> http://developer.apple.com/mac/library/technotes/tn2006/tn2166.html#SECPROTECTIVEMBR

The document describes theory, but does not seem to describe
reality:

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Jun 26 00:32:54 2006 UTC (3 years, 8 months ago) by sobomax
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +24 -5 lines
Improve check for protective MBR. Instead of assiming that protective
MBR should have only one entry of type 0xEE, consider protective MBR
to be one, that has at least one entry of type 0xEE covering the whole
unit. This makes GEOM_GPT compatible with disks partitioned by the
Apple's BootCamp.

Approved in principle by:       marcel
MFC After: 1 month


In short, Apple bootcamp creates an invalid PMBR according to their
own technote.

FYI,

--
Marcel Moolenaar
[hidden email]



_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: another gpt vs mbr (sanity) check

Andriy Gapon-3
on 09/03/2010 00:52 Marcel Moolenaar said the following:
> On Mar 8, 2010, at 12:59 PM, Andriy Gapon wrote:
>> So I'll just post one link about what position Apple had (note the past tense)
>> about protective MBR:
>> http://developer.apple.com/mac/library/technotes/tn2006/tn2166.html#SECPROTECTIVEMBR
>
> The document describes theory, but does not seem to describe
> reality:

Right, that's why I emphasized the past tense.
Thank you for the details.

> Revision 1.39: download - view: text, markup, annotated - select for diffs
> Mon Jun 26 00:32:54 2006 UTC (3 years, 8 months ago) by sobomax
> Branches: MAIN
> Diff to: previous 1.38: preferred, colored
> Changes since revision 1.38: +24 -5 lines
> Improve check for protective MBR. Instead of assiming that protective
> MBR should have only one entry of type 0xEE, consider protective MBR
> to be one, that has at least one entry of type 0xEE covering the whole
> unit. This makes GEOM_GPT compatible with disks partitioned by the
> Apple's BootCamp.
>
> Approved in principle by:       marcel
> MFC After: 1 month
>
>
> In short, Apple bootcamp creates an invalid PMBR according to their
> own technote.
>
> FYI,

It's not only the technote, it's the GPT spec itself.


--
Andriy Gapon
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "[hidden email]"
12
Loading...