Apple Partition Map

{{Short description|Computer disk partitioning standard for legacy Macintosh computers}}

Apple Partition Map (APM) is a partition scheme used to define the low-level organization of data on disks formatted for use with 68k and PowerPC Macintosh computers. It was introduced with the Macintosh II.

Disks using the Apple Partition Map are divided into logical blocks, with 512 bytes usually belonging to each block. The first block, Block 0, contains an Apple-specific data structure called "Driver Descriptor Map" for the Macintosh Toolbox ROM to load driver updates and patches before loading from an MFS or HFS partition. Because APM allows 32 bits worth of logical blocks, the historical size of an APM formatted disk using small blocks is limited to 2 TiB.

The Apple Partition Map maps out all space used (including the map) and unused (free space) on disk, unlike the minimal x86 master boot record that only accounts for used non-map partitions. This means that every block on the disk (with the exception of the first block, Block 0) belongs to a partition.

Some hybrid disks contain both an ISO 9660 primary volume descriptor and an Apple Partition Map, thus allowing the disc to work on different types of computers, including Apple systems.

Intel-based Macs

{{Details|Mac transition to Intel processors}}

For accessing volumes, both APM and GPT partitions can be used in a standard manner with Mac OS X Tiger (10.4) and higher. For starting an operating system, PowerPC-based systems can only boot from APM disks. In contrast, Intel-based systems generally boot from GPT disks. Nevertheless, older Intel-based Macs are able to boot from APM, GPT (GUID Partition Table) and MBR (Master Boot Record, using the BIOS-Emulation called EFI-CSM i.e. the Compatibility Support Module provided by EFI).

Intel-based models that came with Mac OS X Tiger (10.4) or Leopard (10.5) preinstalled had to be able to boot from both APM and GPT disks due to the installation media for these universal versions of Mac OS X, which are APM partitioned in order to remain compatible with PowerPC-based systems. However, the installation of OS X on an Intel-based Mac demands a GPT partitioned disk or will refuse to continue, the same way installation on a PowerPC-based system will demand an APM partitioned destination volume. Cloning an already installed OS X to an APM partition on Intel systems will remain bootable even on 2011 Intel-based Macs. Despite this apparent APM support, Apple never officially supported booting from an internal APM disk on an Intel-based system. The one exception for a universal version of Mac OS X (Tiger or Leopard) is an official Apple document describing how to set up a dual bootable external APM disk for use with PowerPC and Intel.

Layout

Each entry of the partition table is the size of one data block, which is normally 512 bytes. Each partition entry on the table is the size of one block or sector of data. Because the partition table itself is also a partition, the size of this first partition limits the number of entries to the partition table itself.

The normal case is that 64 sectors (64 × 512 = 32 KB) are used by the Apple Partition Map: one block for the Driver Descriptor Map as Block 0, one block for the partition table itself and 62 blocks for a maximum of 62 data partitions.

Each partition entry includes the starting sector and the size, as well as a name, a type, a position of the data area, and a possible boot code. It also includes the total number of partitions in that partition table.{{cite web|url=http://opensource.apple.com/source/IOStorageFamily/IOStorageFamily-116/IOApplePartitionScheme.h|title=IOApplePartitionScheme.h|publisher=Apple|accessdate=2016-08-07|date=2009}} This ensures that, after reading the first partition table entry, the firmware is aware of how many blocks more to read from the media in order to process every partition table entry. All entries are in big-endian byte-order.{{citation needed|date=May 2013}}

class="wikitable"

! colspan="2" | Address !! rowspan="2" | Size
in bytes !! rowspan="2"| Contents !! rowspan="2" | Required?

DecimalHex
style="text-align:right" | 0style="text-align:right" | 0x0000style="text-align:right" | 1signature1 (ASCII value "P")No
style="text-align:right" | 1style="text-align:right" | 0x0001style="text-align:right" | 1signature2 (ASCII value "M")No
style="text-align:right" | 2–3style="text-align:right" | 0x0002style="text-align:right" | 2reservedNo
style="text-align:right" | 4–7style="text-align:right" | 0x0004style="text-align:right" | 4number of partitions (total)Yes
style="text-align:right" | 8–11style="text-align:right" | 0x0008style="text-align:right" | 4starting sector of partitionYes
style="text-align:right" | 12–15style="text-align:right" | 0x000Cstyle="text-align:right" | 4size of partition (in sectors)Yes
style="text-align:right" | 16–47style="text-align:right" | 0x0010style="text-align:right" | 32name of partition (fixed ASCII right-side NULL padded)No
style="text-align:right" | 48–79style="text-align:right" | 0x0030style="text-align:right" | 32type of partition (fixed ASCII right-side NULL padded)No
style="text-align:right" | 80–83style="text-align:right" | 0x0050style="text-align:right" | 4starting sector of data area in partitionNo
style="text-align:right" | 84–87style="text-align:right" | 0x0054style="text-align:right" | 4size of data area in partition (in sectors)No
style="text-align:right" | 88–91style="text-align:right" | 0x0058style="text-align:right" | 4status of partitionNo
style="text-align:right" | 92–95style="text-align:right" | 0x005Cstyle="text-align:right" | 4starting sector of boot codeNo
style="text-align:right" | 96–99style="text-align:right" | 0x0060style="text-align:right" | 4size of boot code (in bytes)No
style="text-align:right" | 100–103style="text-align:right" | 0x0064style="text-align:right" | 4address of bootloader codeNo
style="text-align:right" | 104–107style="text-align:right" | 0x0068style="text-align:right" | 4reservedNo
style="text-align:right" | 108–111style="text-align:right" | 0x006Cstyle="text-align:right" | 4boot code entry pointNo
style="text-align:right" | 112–115style="text-align:right" | 0x0070style="text-align:right" | 4reservedNo
style="text-align:right" | 116–119style="text-align:right" | 0x0074style="text-align:right" | 4boot code checksumNo
style="text-align:right" | 120–135style="text-align:right" | 0x0078style="text-align:right" | 16processor type (fixed ASCII right-side NULL padded)No
style="text-align:right" | 136–511style="text-align:right" | 0x0088style="text-align:right" | 376reservedNo

{{anchor|partition type}}{{anchor|partition name}}Partition identifiers

Types beginning with "Apple_" are reserved for assignment by Apple, all other custom defined types are free to use. However registration

with Apple is encouraged.

class="wikitable sortable"

! Identifier / type !! Contents / file system !! Name (typical) !! class="unsortable" | Remarks

Apple_BootbootloaderMOSX_OF3_Booter, eXternal booterThis boot partition is used by Mac OS X on New World Macs (Open Firmware 3.0 and greater) when the file system on the main partition is not supported by Open Firmware, like in a software RAID configuration or when using a HFS+ case-sensitive or a UFS file system. It contains BootX on an HFS filesystem.
Apple_Boot_RAIDbootloaderRaid Partition
Apple_BootstrapNewWorld bootblockAlthough it is a general Open Firmware (New World) boot partition, it is specifically used by yaboot and GRUB for loading PowerPC Linux, and will not automount under Mac OS X. It must be HFS formatted, so that it can be accessed by Open Firmware.
Apple_Driverdevice driverMacintoshClassic Mac OS drivers partition
Apple_Driver43SCSI Manager 4.3 device driverMacintoshClassic Mac OS drivers partition
Apple_Driver43_CDSCSI CD-ROM device driverMacintoshClassic Mac OS drivers partition
Apple_Driver_ATAATA device driverMacintoshClassic Mac OS drivers partition
Apple_Driver_ATAPIATAPI device driverMacintoshClassic Mac OS drivers partition
Apple_Driver_IOKitI/O Kit driverMacintoshClassic Mac OS drivers partition
Apple_Driver_OpenFirmwareMacintosh
Apple_ExtraunusedThis identifier masks an unused partition map entry.
Apple_Freefree spaceExtraThis identifier masks free space as a partition map entry.
Apple_FWDriverFireWire device driverMacintoshClassic Mac OS drivers partition
Apple_HFSHierarchical File SystemApple_HFSWhile normally a HFS or HFS+ volume for Mac OS and Mac OS X, it can also contain an MS-DOS formatted file system (File Allocation Table, which can be accessed by Mac OS and Mac OS X).
Apple_HFSXHFS PlusThis partition contains a HFS+ volume without a HFS wrapper. HFSX was introduced with Mac OS X 10.3 and is only used in special cases, like case sensitive HFS+. HFSX is the standard partition type on Intel-based Macs (which use GPT instead of APM).
Apple_LoaderSecondaryLoaderLike Apple_Boot but on Old World Macs, it is used when Mac OS X is installed on a file system not readable by Open Firmware. This partition does not contain a filesystem—instead it contains the BootX machine code in XCOFF format. This partition type was discontinued with Mac OS X 10.3.
Apple_MDFWfirmwarefirmwareThis partition is used by iPod to load the firmware/OS.
Apple_MFSMacintosh File SystemThis partition is used by Mac OS for the Macintosh File System (MFS), which was introduced with the Macintosh 128K in 1984.
Apple_partition_mappartition mapAppleThe partition map is also a partition of its own. It can vary in size depending on how many partitions it may contain.
Apple_PatchespatchesPatch PartitionMac OS classic patch partition
Apple_PRODOSProDOSProDOS file system
Apple_RAIDRAIDApple_RAID_OfflineV2This identifier marks a Mac OS X partition used in a software RAID configuration. It normally contains the same filesystems a regular Mac OS X installation would have, like HFS/HFS+ or UFS. The separate boot partition Apple_Boot is mandatory.
Apple_Rhapsody_UFSUnix File SystemMac OS X ServerThis partition contains a Unix File System (UFS) used by the Apple Rhapsody operating system (a development name marking the transition from OPENSTEP to Mac OS X) and is also used by Mac OS X Server 1.0 through 1.2 v3.
Apple_ScratchemptyThis identifier marks an empty partition.
Apple_SecondSecond stage bootloader
Apple_UFSUnix File SystemMac OS XThis partition contains a Unix File System (UFS) and is used by Mac OS X, Mac OS X Server (Version 10.0 and newer) and various Unix-like operating systems.
Apple_UNIX_SVR2A/UX, UnixOriginally introduced for A/UX (Apple Unix operating system based on System V Release 2, hence SVR2) on the 68k, it was later reused for MkLinux which used the Extended file system. It is the standard partition identifier for many Unix-like operating systems, including Linux and NetBSD. It may contain any file system suitable for the installed operating system. If bootable, a file system that can be read by the Open Firmware bootloader from Apple_Bootstrap (e.g. yaboot) must be used.
Apple_VoidISO9660 paddingA dummy partition map entry to ensure correct partition alignment on bootable media.
Be_BFSBe File SystemThis partition contains a Be File System (BFS) and is normally used by BeOS.
MFS

|TiVo Media File System

| MFS application region, MFS media region

|Used to hold the proprietary Media File System on TiVo hard drives formatted using Apple Partition Map.

= Partition status =

Partition status is a bit field composed of the flags:

class="wikitable"

! Value !! Description !! System

style="text-align:right" | 0x00000001entry is validA/UX
style="text-align:right" | 0x00000002entry is allocatedA/UX
style="text-align:right" | 0x00000004entry in useA/UX
style="text-align:right" | 0x00000008entry contains boot informationA/UX
style="text-align:right" | 0x00000010partition is readableA/UX
style="text-align:right" | 0x00000020partition is writableA/UX, Macintosh
style="text-align:right" | 0x00000040boot code is position independentA/UX
style="text-align:right" | 0x00000100partition contains chain-compatible driverMacintosh
style="text-align:right" | 0x00000200partition contains a real driverMacintosh
style="text-align:right" | 0x00000400partition contains a chain driverMacintosh
style="text-align:right" | 0x40000000automatically mount at startupMacintosh
style="text-align:right" | 0x80000000the startup partitionMacintosh

See also

References

{{cite web

|url=https://developer.apple.com/library/mac/technotes/tn2166/

|title=Technical Note TN2166 – Secrets of the GPT

|publisher=Apple

|accessdate=2013-02-24

|quote=...a standard block size of 512 bytes...Apple did consider extending APM to support larger disks. However, as such a change would break all existing partitioning tools...}}

[http://support.apple.com/kb/TA21692 Mac OS: Technical overview of disk volume structures]

Apple Support Communities: [https://discussions.apple.com/thread/2786955?start=15&tstart=0 Guid Partition or Apple Partition?] (2012)

Apple Support Communities: [https://discussions.apple.com/thread/6503281 Create a bootable clone using Disk Utility] (2014): an example of problems trying to boot on an Intel Mac using an APM partitioned drive.

Apple Support Communities: [https://discussions.apple.com/thread/6117917 Running Mavericks + FCPX on External Boot Drive?] (2014): OS X Mavericks does not boot from APM partitioned drives.

MacTech Magazine: [http://www.mactech.com/articles/mactech/Vol.23/23.03/APMtoGPT/index.html Apple's Transition from Apple Partition Map to the GUID Partition Table] by Criss Myers

Apple Mailing List: [http://lists.apple.com/archives/Macos-x-server/2006/Apr/msg01335.html Subject: Re: Apple Partition Scheme or GUID Partition Scheme] {{Webarchive|url=https://web.archive.org/web/20090406065521/http://lists.apple.com/archives/Macos-x-server/2006/Apr/msg01335.html |date=2009-04-06 }}, Timothy Standing, 2006-04-30

OWC: [http://eshop.macsales.com/articles/booting-your-intel-mac-to-an-apm-formatted-drive Booting your Intel Mac to an APM-formatted drive], M. Christopher Stevens

[http://support.apple.com/kb/HT2595 Mac OS X 10.5: Creating and maintaining a bootable "universal" external disk]

{{cite web

|url=http://www.t2-project.org/handbook/html/t2.partition.apple.html

|title=Creating custom Linux solutions – Apple Partition Map

|first1=René

|last1=Rebe

|first2=Susanne

|last2=Klaus

|work=T2 System Development Environment

|date=2007

|quote=While the original intent was to handle various block sizes, in practice only 512 byte blocks are supported.}}

{{cite web

|url=http://www.ydl.net/support/solutions/ydl_2.x/firewire_disks.shtml

|title=Yellow Dog Solutions – Attaching Firewire Disks to a Linux Box

|publisher=Fixstars Corporation

|accessdate=2013-02-24

|quote=Comment: The command pdisk -l /dev/sda shows a size of 63 blocks for the Apple_partition_map. There is a multitude of examples like this to be found on the internet.

|archive-url=https://web.archive.org/web/20091013105411/http://www.ydl.net/support/solutions/ydl_2.x/firewire_disks.shtml

|archive-date=2009-10-13

|url-status=dead

}}