Re: GPT - (last) call for action

From: Chuck Swiger <cswiger_at_mac.com>
Date: Mon, 11 Jun 2007 13:12:04 -0700
On Jun 11, 2007, at 12:52 PM, Rui Paulo wrote:
>> A typical Intel Mac system using GPT ought to look something like  
>> this:
>>
>> # fdisk /dev/rdisk0
>> Disk: /dev/rdisk0       geometry: 9964/255/63 [160086528 sectors]
>> Signature: 0xAA55
>>           Starting       Ending
>> #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
>> --------------------------------------------------------------------- 
>> ---
>> 1: EE 1023 254  63 - 1023 254  63 [         1 -  160086520]  
>> <Unknown ID>
>> 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused
>> 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused
>> 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused
>>
>> # gpt -r show /dev/rdisk0
>>        start       size  index  contents
>>            0          1         PMBR
>>            1          1         Pri GPT header
>>            2         32         Pri GPT table
>>           34          6
>>           40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-
>> xxxxxxxxxxxx
>>       409640  159414704      2  GPT part - 48465300-0000-11AA-AA11-
>> xxxxxxxxxxxx
>>    159824344     262151
>>    160086495         32         Sec GPT table
>>    160086527          1         Sec GPT header
>
> Well, what's happening is that Boot Camp syncs the BIOS partition
> table with the GPT table, so the first partition should start at 40,
> just like the GPT.
>
> Why does it start at 40 ? Because you need room for the PMBR, the
> Primary GPT header and the Primary GPT table.

Agreed, you need about 32 sectors for the GPT header+table.

> Now, you don't seem to have used Boot Camp on your Mac, right?

It's true that the machine in question has never used BootCamp, correct.

> If you ever use it, fdisk /dev/rdisk0 will show things differently.
> The first partition with id 0xEE will should start at LBA 40 and end
> at LBA 409640.

OK: although that surprises me a bit, perhaps trying to get Windows  
XP (which may not understand the ~32 sector GPT header+table) means  
that claiming the first partition in the MBR starts at 40 works  
better...?

>> The first, small partition is almost certainly a "boothfs" boot
>> partition, as described in the man page for Apple's version of
>> fdisk:
>
> I don't think so.
> The boothfs partition doesn't seem to be used on Intel Macs no
> longer. The EFI boot loader that comes with Intel Macs can read HFS+
> without any help (actually it's an EFI module), so bootufs/boothfs
> partitions are no longer required.

It looks like you're right-- the OS-X formatting utilities still  
reserve space for the boot partition, but they just scribble enough  
to this space to indicate that the partition isn't actually bootable:

# dd if=/dev/disk0s1 bs=512 count=409600 | hexdump -C
00000000  eb 58 90 42 53 44 20 20  34 2e 34 00 02 01 20 00  |.X.BSD   
4.4... .|
00000010  02 00 00 00 00 f0 00 00  00 00 00 00 28 00 00 00   
|............(...|
00000020  00 40 06 00 67 0c 00 00  00 00 00 00 02 00 00 00   
|._at_..g...........|
00000030  01 00 06 00 00 00 00 00  00 00 00 00 00 00 00 00   
|................|
00000040  00 00 29 f4 11 60 28 45  46 49 20 20 20 20 20 20  |..)..` 
(EFI      |
00000050  20 20 46 41 54 33 32 20  20 20 fa 31 c0 8e d0 bc  |   
FAT32   .1....|
00000060  00 7c fb 8e d8 e8 00 00  5e 83 c6 19 bb 07 00 fc   
|.|......^.......|
00000070  ac 84 c0 74 06 b4 0e cd  10 eb f5 30 e4 cd 16 cd   
|...t.......0....|
00000080  19 0d 0a 4e 6f 6e 2d 73  79 73 74 65 6d 20 64 69  |...Non- 
system di|
00000090  73 6b 0d 0a 50 72 65 73  73 20 61 6e 79 20 6b 65  | 
sk..Press any ke|
000000a0  79 20 74 6f 20 72 65 62  6f 6f 74 0d 0a 00 00 00  |y to  
reboot.....|
000000b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   
|................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa   
|..............U.|
00000200  52 52 61 41 00 00 00 00  00 00 00 00 00 00 00 00  | 
RRaA............|
00000210  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   
|................|
*
000003e0  00 00 00 00 72 72 41 61  ff ff ff ff ff ff ff ff   
|....rrAa........|
000003f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa   
|..............U.|
00000400  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   
|................|
*
00000c00  eb 58 90 42 53 44 20 20  34 2e 34 00 02 01 20 00  |.X.BSD   
4.4... .|
00000c10  02 00 00 00 00 f0 00 00  00 00 00 00 28 00 00 00   
|............(...|
00000c20  00 40 06 00 67 0c 00 00  00 00 00 00 02 00 00 00   
|._at_..g...........|
00000c30  01 00 06 00 00 00 00 00  00 00 00 00 00 00 00 00   
|................|
00000c40  00 00 29 f4 11 60 28 45  46 49 20 20 20 20 20 20  |..)..` 
(EFI      |
00000c50  20 20 46 41 54 33 32 20  20 20 fa 31 c0 8e d0 bc  |   
FAT32   .1....|
00000c60  00 7c fb 8e d8 e8 00 00  5e 83 c6 19 bb 07 00 fc   
|.|......^.......|
00000c70  ac 84 c0 74 06 b4 0e cd  10 eb f5 30 e4 cd 16 cd   
|...t.......0....|
00000c80  19 0d 0a 4e 6f 6e 2d 73  79 73 74 65 6d 20 64 69  |...Non- 
system di|
00000c90  73 6b 0d 0a 50 72 65 73  73 20 61 6e 79 20 6b 65  | 
sk..Press any ke|
00000ca0  79 20 74 6f 20 72 65 62  6f 6f 74 0d 0a 00 00 00  |y to  
reboot.....|
00000cb0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   
|................|
*
00000df0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa   
|..............U.|
00000e00  52 52 61 41 00 00 00 00  00 00 00 00 00 00 00 00  | 
RRaA............|
00000e10  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   
|................|
*
00000fe0  00 00 00 00 72 72 41 61  ff ff ff ff ff ff ff ff   
|....rrAa........|
00000ff0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa   
|..............U.|
00001000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   
|................|
*
00004000  f0 ff ff 0f ff ff ff 0f  ff ff ff 0f 00 00 00 00   
|................|
00004010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   
|................|
*
00190e00  f0 ff ff 0f ff ff ff 0f  ff ff ff 0f 00 00 00 00   
|................|
00190e10  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   
|................|
*
0031dc00  45 46 49 20 20 20 20 20  20 20 20 08 00 00 00 00  | 
EFI        .....|
0031dc10  00 00 00 00 00 00 1b a7  85 35 00 00 00 00 00 00  |......... 
5......|
0031dc20  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   
|................|
*
409600+0 records in
409600+0 records out

-- 
-Chuck
Received on Mon Jun 11 2007 - 18:12:06 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:12 UTC