TweetFollow Us on Twitter

Apple's Transition from Apple Partition Map to the GUID Partition Table

Volume Number: 23 (2007)
Issue Number: 03
Column Tag: System Technologies

Apple's Transition from Apple Partition Map to the GUID Partition Table

By Criss Myers

Preface

In January 2006, Apple moved from PowerPC processors to Intel processors. This brought with it a number of changes to the way that a Macintosh works. These changes involved the move from the IBM manufactured PowerPC RISC chip to the Intel Core Duo CISC chip, which meant a move for Apple to an X86 architecture. At the same time, Apple chose to make a few other changes. One was the move from Open Firmware, the open source version of Sun Microsystems boot firmware, to Intel's Exstensible Firmware Interface (EFI), previously used on Intels Itanium hardware. Another major change involved a change to the partitioning structure of the disk. Apple moved from its long standing Apple Partition Map (APM) to the Intel-created GUID Partition table (GPT) which is part of the EFI specification. This article will examine these changes to the partitioning structure and assess the impact that this will have on Apple.

APM vs GPT

Apple Partition Map (APM)

Apple's Partition Map was created in 1987 by Apple for the Macintosh II and has remained relatively unchanged since then. APM is a very robust and simple partition structure for partitioning a drive which can then be formated as either HFS or HFS+ filesystem. Unlike DOS partitions, APM does not contain any boot code; the computer's Open Firmware has the code to read this structure. The APM is read by Open Firmware, then the HFS+ file system is read and finally, the Operating System is booted. Open Firmware can only boot Operating Systems from HFS filesystems. Also unlike DOS partitioning, APM can describe as many partitions as required, whereas DOS is limited to 4 primary partitions. This type of partition structure is used on desktop Macs and portables as well as iPods and apples disk images, it is also used on dual formated CD's.

APM Structure

Hard disks are divided into blocks, or sectors, and each block typically consists of 512 bytes. On a Mac, hard disk block 0 is the driver descriptor block and contains the driver description record.

Block 1, actually the second block, contains the Apple Partition Map. Unlike other partition structures, it is defined as a partition in its own right. The APM describes the partition sturcture of the drive and contains partition entries for each partition including one for itself. These partition entries can be in any particular order and do not need to correspond to the physical organisation of the partitions. The number of partition entries is not restricted, but the map cannot be enlarged later. Once the drive has been partitioned and the APM created, the remaining space on the drive belongs to the rest of the partitions, and there is therefore no free space to enlarge the APM at a later time. All space on the drive must belong to a partition, as APM does not support free space. The APM is read by Open Firmware and all partition entries are read in order.

Partition Map Entries

The APM is layed out in 512 byte data structures, each 512 data structure is a map entry and defines each partition, these entries are laid out in consecutive sectors. Each entry describes how many partitions exist, the starting sector of the partition, its size and type, as well as volume name, the location of the data area and location of any boot code. Since each 512byte data structure lists the number of total partitions on the disk, from this the Open Firmware knows how many sectors to read in order for it to read the whole partition map.

Figure 1 shows the typical layout of an APM, the Partition Map being the first entry and also a partition, the second entry is partition 1, etc.


Fig 1. Typical Partition Map

Figure 2 shows the entry details for a single 512byte Partition Map Entry


Fig 2. Partition Map Entry


Fig 3. Status value for Apple partitions.

GPT

EFI, Extensible Firmware Inrerface, was created by Intel in an effort to introduce a modern firmware for generic PC hardware. GPT is the partitoning scheme included in this firmware. The traditional Master Boot Record used by most legacy PC BIOS systems has severe limitations and is outdated. Interestingly, due to the way the PC BIOS "grew up", it also has no official specifications. GPT was first used on Intel's Itanium hardware along with EFI.

GPT is defined by a formal standard as part of EFI. EFI is defined by Intel's "Extensible Firmware Interface Specification", version 1.1, or by UEFI, "Unified Extensible Firmware Interface Specification", version 2.0, to which many companies belong, called the Unifed EFI Forum. Apple is a member of this group.

It is very similar to Apple's APM scheme in that it also uses Logical Block Addressing (LBA) with each block being 512bytes. GPT is a partition scheme which defines the partitioning but unlike APM (which is defined as a partition itself in block 1) GPT encompasses the whole drive with a secondary partition table at the end of the drive. This acts as a backup for the primary data.

Like APM, GPT starts at block 1, but unlike APM which uses block 0 as the drive descriptor block, GPT uses block 0 as a Protective MBR (Master Boot Record). The purpose of the Protective MBR is protect the GPT drive from legacy PC BIOS Systems. EFI systems will read the GPT scheme on the drive, however, legacy MBR disk formatting tools cannot read GPT and would therefore potentionally write over it. The Protective MBR can be read by these disk utilites and indicates a single partition encompassing all of the GPT partitions on the drive. A system ID for this partition is set to 0xEE which indicates a GPT drive, EFI then reads this ID and thus ignores the protective MBR, however, 32bit Operating Systems will still read this and see it as a single inacessable disk.


Fig 4. Typical GPT Partition layout

The Fig 4 shows the Protective Master Boot Record (PMBR) in Logical Block Address 0 (LBA0), the Primary and Backup Partition Table at the beginning and end of the disk, consisting of the Table header and the table entries in purple.

Block 1 contains the Primary GPT Partition table header, this defines the usable blocks on the disk as well as the number and size of the partition entrys that make up the table. The header contains the disk GUID. It records its own size and location (always block1) and the secondary header, the last sector on the disk which can be used to recover a corrupt header. It also contains a CRC32 checksum for itself and the partition table (blocks 2-33) This checksum is read and verified by EFI and if found to be corrupt EFI will use the secondary header and write this header over the primary one. If both are corrupt then the drive is unreadable.

Figure 5 shows the entry details for a 512byte GPT Partition Table Header.


Fig 5. GUID Partition Table Header

Blocks 2-33 are the primary GPT entry array, these 32 sectors are reserved for GPT partitions. This equals 16,384 bytes and therefore a possible 128 partition entries of 128bytes. This GPT Entry Array is then mirrored by the secondary GPT Entry Array at the end of the disk, before the secondary partition header, which it uses to recover a damaged primary entry array. Since these blocks are reserved, this means that, unlike APM, the partition table can be altered at any time to create new partitions up to 128. An empty entry array is defined as 0, indicating that it is not in use. These arrays are continuous.

Each entry is simple and contains 128bytes, the first 16bytes designate the partition type with a partiton type GUID. The second 16bytes contains a GUID unique to the partition so that the partition can be identified. The rest of the bytes contain the partition names and attributes as well as the start and end blocks. These entries do not need to be sorted and just like the APM, they do not have to be in the same order as the partitions.

The remaining blocks on the disk are then the usable blocks for the partitions, but unlike APM, GPT does not require that all blocks must belong to a partition, therefore unpartitoned blocks are free space.

Figure 6 shows a typical Partition Enrty for a single partition.


Fig 6. GPT Partition Entry

Conclusions to Draw

As we can see, APM is restricted to 32 bits worth of blocks which will limit the total disk size to 2 terabytes. At the moment this is not really much of a problem but with disk sizes getting larger all the time this is a potential future limitation. Apple was given a choice: they could extend APM to support larger disk sizes, which would break all exisiting partitioning tools, or move to a completely different partition scheme. When Apple decided to move to an Intel based platform and switch from Open Firmware to an EFI, it gave them the perfect opportunity to use the GPT partition scheme. As we can see, this partition scheme is not unlike APM but offers more flexibility and backup recovery. However it does mean that there are compatabilty issues. An open firmware machine cannot boot from a GPT disk. Any Apple machine, be it PowerPC or Intel, running 10.4 and above can mount both a GPT disk and an APM disk. Any machine running 10.4.6 and above can also format GPT disks.

The GPT standard is very flexible and does not define exacty how to partition a disk. It merely describes the realm of what is possible. This means Apple can implement their own support for GPT, as can third party companies.

Apple's implementation of GPT

Apple has defined a set of Apple-specific partition types which are enterd in bytes 0-15 of the Partition Entry. Figure 7 describes these types.


Fig. 7 Apple Partition Types.

Apple also defines a partition policy for its disks and the way in which the partition map is layed out. Apple defines disks in 3 ways, tiny, small and big. Tiny being less than 1GB, small being between 1GB and 2GB and big being any disk larger than 2GB.

Tiny disks are created with no reserved free space and no extra partitions; the partitions are laid out as the user specifies.

Small disks are created with no extra partitions but have 128mb of free space at the end of each partition.

Big disks always have a 200mb EFI system partition called ESP as the first partition on the disk and also have the 128mb of free space after each partition (not including the ESP partition).

Each disk is then aligned to a 4KB boundary to accommodate the limitations of the HFS plus file system implimentation on Mac OS X.

Free space is left at the end of each partition to make it easier for future system software to manipulate the partition map in ways that Apple cannot anticipate at the moment.

ESP is a special partition from which EFI can load EFI boot-time device drivers. Apple's EFI supports ESP but does not use it at the moment but when you format a GPT disk this partition is created for future use.

We can see that Apple has done everything to support the compatibility of both APM and GPT and has considered future development when laying out the GPT partition on Apple disks. In general, there should be no issues with switching from APM to GPT: your new Intel Mac will be able to mount and write to any existing external drives you might have that are partitioned as APM, and as long as you have 10.4 on your PowerPC Mac you can mount and write to your GPT external drives. There should be no need to boot a GPT drive on a PowerPC.

There are, however, a few concerns when copying disks. These will mostly apply to software developers creating cloning and backup tools for GPT. In the GPT header is a GUID for the disk, and by its definition (globally unique ID) is a unique number. Apple system software relies on this to identify disks, and if a disk is cloned by a block-by-block tool, then both disks with have the exact same number. If the copy is to be a backup of the original and to be used to restore the original, then an identical GUID is required. However if the copy is to be used online as a duplicate, then the disk GUID will need to be changed so the system sees each drive as a different copy.

One last issue is with certain drive's firmware. Some drive firmware can be buggy and report errors when the very last block on a disk is accessed. For an APM disk this is not an issue as Apple's implementation of APM creates a small Apple_Free partition at the end of the disk for this reason. GPT requires the use of the last block for its backup partition table header and this cannot be avoided. Apples implementation ignores any errors given when reading the backup header. If an error occurs the disk has a valid primary but an invalid backup, such a disk is still considered readable. This disk will not be able to recover if the primary gets damaged. If the error occurs when the partition scheme is being created then the partitioning will fail and the drive cannot be partitioned by Apple software.

If you wish to run other operating systems on an Intel Mac such as Linux or Windows there are not many options, RedHat is developing a GPT based OS and Windows Vista should support GPT. Apple's move to GPT will make multi booting a Mac much easier in the future once GPT compatible operating systems are written and as more and more PC hardware manufacturers adopt EFI and GPT.

Bibliography and References

Apple Computers. Technical Note TN2166. Secrets of the GPT, Copyright 2006 Apple Computers Inc.

Brian Carrier. File System Forensic Analysis: PC Based Partitions, Chapter 3, Apple Partitions, Copyright 2005.

UEFI. UEFI Extensible Firmware Interface Specifications Version 2.0, Chapter 5 GUID Partition Table (GPT) Format, Copyright 2006.


Criss Myers is a Senior Mac IT Technician for the Faculty of Science and Technology, at the University of Central Lancashire, Preston, United Kingdom. He has been a Systems Server Administrator from the very first version of OS X Server. He Works with Macs as well as Linux, Unix and Windows.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Hopper Disassembler 5.6.1 - Binary disas...
Hopper Disassembler is a binary disassembler, decompiler, and debugger for 32- and 64-bit executables. It will let you disassemble any binary you want, and provide you all the information about its... Read more
Skim 1.6.11 - PDF reader and note-taker...
Skim is a PDF reader and note-taker for OS X. It is designed to help you read and annotate scientific papers in PDF, but is also great for viewing any PDF file. Skim includes many features and has a... Read more
Alfred 4.6.7 - Quick launcher for apps a...
Alfred is an award-winning productivity application for OS X. Alfred saves you time when you search for files online or on your Mac. Be more productive with hotkeys, keywords, and file actions at... Read more
Transmit 5.8.7 - Excellent FTP/SFTP clie...
Transmit is an excellent FTP (file transfer protocol), SFTP, S3 (Amazon.com file hosting) and iDisk/WebDAV client that allows you to upload, download, and delete files over the internet. With the... Read more
Adobe Lightroom Classic 11.4.1 - Import,...
You can download Lightroom for Mac as a part of Creative Cloud for only $9.99/month with Photoshop, included as part of the photography package. The latest version of Lightroom gives you all of the... Read more
MarsEdit 4.5.9 - Quick and convenient bl...
MarsEdit is a blog editor for OS X that makes editing your blog like writing email, with spell-checking, drafts, multiple windows, and even AppleScript support. It works with with most blog services... Read more
Thunderbird 91.11.0 - Email client from...
As of July 2012, Thunderbird has transitioned to a new governance model, with new features being developed by the broader free software and open source community, and security fixes and improvements... Read more
A Better Finder Rename 11.50 - File, pho...
A Better Finder Rename is the most complete renaming solution available on the market today. That's why, since 1996, tens of thousands of hobbyists, professionals and businesses depend on A Better... Read more
DaisyDisk 4.23 - $9.99
DaisyDisk allows you to visualize your disk usage and free up disk space by quickly finding and deleting big unused files. The program scans your disk and displays its content as a sector diagram... Read more
BBEdit 14.5 - Powerful text and HTML edi...
BBEdit is the leading professional HTML and text editor for the Mac. Specifically crafted in response to the needs of Web authors and software developers, this award-winning product provides a... Read more

Latest Forum Discussions

See All

Downhill Mountain Biking Game ‘Descender...
Just over three years ago in May of 2019 developer RageSquid and publisher No More Robots released a quirky downhill mountain biking game called Descenders on PC and Xbox One. Bemoaning a lack of “extreme sports" titles in recent years led RageSquid... | Read more »
SwitchArcade Round-Up: ‘Monster Hunter R...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for June 30th, 2022. Thursday is once more upon us, and that means a bunch of new releases to look at. We start things off with DLC for some very big games, Monster Hunter Rise and... | Read more »
‘HOOK 2’ Review – A Sharp Left Hook From...
The original HOOK ($1.99) had a very simple idea behind it. You were presented with a tangled mess of hooks and loops, and you needed to remove each one without snagging any others. Extremely simple at first, but as the puzzles rolled along,... | Read more »
‘Dicey Dungeons’ Mobile Version Launchin...
After a very long wait, Terry Cavanagh’s dungeon crawling roguelite deckbuiler hybrid experience Dicey Dungeons is coming to mobile platforms next week alongside a huge free DLC pack on all platforms. This DLC will be included in the mobile... | Read more »
Distract Yourself With These Great Mobil...
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links below... | Read more »
‘Danganronpa S: Ultimate Summer Camp’ is...
If you’ve been following Danganronp over the last few years, Spike Chunsoft celebrated its anniversary by bringing the series to mobile in the form of anniversary editions. After the first two released, there was a long delay for V3, but it finally... | Read more »
Out Now: ‘HOOK 2’, ‘Incoherence’, ‘Juras...
Each and every day new mobile games are hitting the App Store, and so each week we put together a big old list of all the best new releases of the past seven days. Back in the day the App Store would showcase the same games for a week, and then... | Read more »
Upcoming Mobile MMO RPG Shooter ‘Avatar:...
This past January a contingent of developers made up of Archosaur Games, Tencent, Lightstorm Entertainment, and Disney announced a new mobile game set in James Cameron’s Avatar universe titled Avatar: Reckoning. | Read more »
Culinary Platformer ‘Chefy-Chef’ Coming...
If your name is Chefy, it’s pretty much a given that you should be a chef. Such is the case with Chefy-Chef, a game from Bug Studio about a chef named Chefy who must travel to all sorts of exotic locations using a magical refrigerator in an effort... | Read more »
SwitchArcade Round-Up: Nintendo Direct H...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for June 29th, 2022. As the month winds to a close, we’ve got a bigger-than-usual Wednesday for both news and new games to check out. I’ve got some crib notes for yesterday’s Nintendo... | Read more »

Price Scanner via MacPrices.net

2nd generation 4K Apple TVs with Siri remote...
Apple has restocked a full line of Certified Refurbished 2nd generation 32GB and 64GB 4K Apple TVs with Siri remotes for $30 off the cost of new models. Apple’s standard one-year warranty is included... Read more
Back in stock: Apple Watch Series 7 models fo...
Apple has restocked Certified Refurbished Apple Watch Series 7 WiFi-only models in their online store for $60-$70 off MSRP, starting at $339. Each Watch includes Apple’s standard one-year warranty, a... Read more
July 4th Sale at Expercom: $200 off any 16″ M...
Apple reseller Expercom has 16″ M1 Pro and M1 Max MacBook Pros available for $200 off MSRP as part of their July 4th sale. In addition to their MacBook Pro sale prices, take $50 off AppleCare+ when... Read more
10.2″ Apple iPads (WiFi models) are on sale f...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for up to $20-$50 off MSRP for a limited time. Their prices are the lowest price currently available for one of these iPads. All models are... Read more
10-Core M1 Pro 14″ MacBook Pros on sale for $...
B&H Photo is offering $200 discounts on Apple’s new 14″ M1 Pro MacBook Pros with 10-Core CPUs (16GB RAM/1TB SSDs). Free 1-2 day shipping is available to most US addresses, and both models are in... Read more
B&H has 16-inch M1 Pro MacBook Pros in st...
New Space Gray 16″ MacBook Pros with Apple’s M1 Pro CPUs are in stock and on sale today at B&H Photo for $200 off Apple’s MSRP. Sale prices are for M1 Pro models with 512GB or 1TB of SSD storage... Read more
Price drop! 13″ M1 MacBook Pro with 512GB SSD...
Amazon has dropped prices on recently-discontinued 13″ M1 MacBook Pros with a 512GB SSD by $200 off Apple’s original MSRP. Shipping is free: – 2020 13″ MacBook Pro (Space Gray or Silver) M1 CPU/512GB... Read more
Deal Alert! 14″ Apple MacBook Pros with M1 Pr...
Amazon has 14″ MacBook Pros with 8-Core M1 Pro CPUs back on sale for $200 off MSRP, only $1799. Shipping is free. Be sure to make your purchase from Amazon rather than a third-party seller: – 14″ M1... Read more
16″ MacBook Pros with Apple M1 Pro CPUs are b...
Amazon is discounting new 16″ MacBook Pros with 10-Core Apple M1 Pro CPUs by $200 off MSRP again today. Be sure to select Amazon as the seller rather than a third-party seller, and note that Amazon’s... Read more
13″ M1 MacBook Airs with 16GB of RAM availabl...
Apple has 13″ M1 MacBook Airs (8-Core CPU/7-Core GPU) in stock today with 16GB of RAM for $190 off MSRP, Certified Refurbished. Apple includes a standard one-year warranty with these models, each... Read more

Jobs Board

I/S Senior Engineer - *Apple* Systems Engin...
**19647BR** **Position Title:** I/S Senior Engineer - Apple Systems Engineering - Remote **Department:** Information Systems **Location:** Lakeland, FL between Read more
*Apple* IT Support Analyst - 2nd Shift - Zon...
Apple IT Support Analyst - 2nd Shift Professional Services Albany, New York Malta, New York Clifton Park, New York Menands, New York Syracuse, New York Watertown, Read more
Infotainment Certification Test Engineer (XC)...
…integration - CarPlay, android auto, MirrorLink, Baidu Carlife, MFi/iPod certification testing; Apple PPID preparation, Google HUCD and GTM preparation + 3 years of Read more
Workplace Services *Apple* Device Managemen...
…3350 Riverwood Parkway Suite 900, Atlanta, GA, 30339 USA **Workplace Services Apple Device Management** **Role Overview** Carrier is seeking an experienced and Read more
Physician Assistant - Certified, Primary Care...
Physician Assistant - Certified, Primary Care, Apple Valley (1.07FTE) + Job ID: 65766 + Department: AV Primary Care + City: Apple Valley, MN + Location: HP - Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.