Apple Partition Map

Last updated

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. [1]

Contents

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. [2] Because APM allows 32 bits worth of logical blocks, the historical size of an APM formatted disk using small blocks [3] is limited to 2 TiB. [4]

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

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. [5] In contrast, Intel-based systems generally boot from GPT disks. [1] [6] [7] 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. [8] 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. [9]

Layout

Each entry of the partition table is the size of one data block, which is normally 512 bytes. [1] [10] 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. [11]

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. [12] 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 ]

AddressSize
in bytes
ContentsRequired?
DecimalHex
00x00001signature1 (ASCII value "P")No
10x00011signature2 (ASCII value "M")No
2–30x00022reservedNo
4–70x00044number of partitions (total)Yes
8–110x00084starting sector of partitionYes
12–150x000C4size of partition (in sectors)Yes
16–470x001032 name of partition (fixed ASCII right-side NULL padded)No
48–790x003032 type of partition (fixed ASCII right-side NULL padded)No
80–830x00504starting sector of data area in partitionNo
84–870x00544size of data area in partition (in sectors)No
88–910x00584 status of partition No
92–950x005C4starting sector of boot codeNo
96–990x00604size of boot code (in bytes)No
100–1030x00644address of bootloader codeNo
104–1070x00684reservedNo
108–1110x006C4boot code entry pointNo
112–1150x00704reservedNo
116–1190x00744boot code checksum No
120–1350x007816processor type (fixed ASCII right-side NULL padded)No
136–5110x0088376reservedNo

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.

Identifier / typeContents / file system Name (typical)Remarks
Apple_Boot bootloader MOSX_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_RAID bootloader Raid 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_Driver device driver MacintoshClassic Mac OS drivers partition
Apple_Driver43 SCSI Manager 4.3 device driver MacintoshClassic Mac OS drivers partition
Apple_Driver43_CD SCSI CD-ROM device driver MacintoshClassic Mac OS drivers partition
Apple_Driver_ATA ATA device driver MacintoshClassic Mac OS drivers partition
Apple_Driver_ATAPI ATAPI device driver MacintoshClassic Mac OS drivers partition
Apple_Driver_IOKitI/O Kit driver MacintoshClassic 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_FWDriver FireWire device driver MacintoshClassic Mac OS drivers partition
Apple_HFS Hierarchical File System Apple_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_HFSX HFS Plus This 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_MDFW firmware firmwareThis partition is used by iPod to load the firmware/OS.
Apple_MFS Macintosh File System This 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_PRODOS ProDOS ProDOS file system
Apple_RAID RAID Apple_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_UFS Unix File System Mac 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_UFS Unix File System Mac 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_SVR2 A/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_Void ISO9660 padding A dummy partition map entry to ensure correct partition alignment on bootable media.
Be_BFS Be File System This partition contains a Be File System (BFS) and is normally used by BeOS.
MFS TiVo Media File System MFS application region, MFS media regionUsed 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:

ValueDescriptionSystem
0x00000001entry is validA/UX
0x00000002entry is allocatedA/UX
0x00000004entry in useA/UX
0x00000008entry contains boot informationA/UX
0x00000010partition is readableA/UX
0x00000020partition is writableA/UX, Macintosh
0x00000040boot code is position independent A/UX
0x00000100partition contains chain-compatible driverMacintosh
0x00000200partition contains a real driverMacintosh
0x00000400partition contains a chain driverMacintosh
0x40000000automatically mount at startupMacintosh
0x80000000the startup partitionMacintosh

See also

Related Research Articles

<span class="mw-page-title-main">ISO 9660</span> File system for CD-R and CD-ROM optical discs

ISO 9660 is a file system for optical disc media. The file system is an international standard available from the International Organization for Standardization (ISO). Since the specification is available for anybody to purchase, implementations have been written for many operating systems.

File Allocation Table (FAT) is a file system developed for personal computers and was the default filesystem for MS-DOS and Windows 9x operating systems. Originally developed in 1977 for use on floppy disks, it was adapted for use on hard disks and other devices. The increase in disk drives capacity required four major variants: FAT12, FAT16, FAT32, and ExFAT. FAT was replaced with NTFS as the default file system on Microsoft operating systems starting with Windows XP. Nevertheless, FAT continues to be used on flash and other solid-state memory cards and modules, many portable and embedded devices because of its compatibility and ease of implementation.

Hierarchical File System (HFS) is a proprietary file system developed by Apple Inc. for use in computer systems running Mac OS. Originally designed for use on floppy and hard disks, it can also be found on read-only media such as CD-ROMs. HFS is also referred to as Mac OS Standard, while its successor, HFS Plus, is also called Mac OS Extended.

<span class="mw-page-title-main">Disk partitioning</span> Creation of separate accessible storage areas on a secondary computer storage device

Disk partitioning or disk slicing is the creation of one or more regions on secondary storage, so that each region can be managed separately. These regions are called partitions. It is typically the first step of preparing a newly installed disk after a partitioning scheme is chosen for the new disk before any file system is created. The disk stores the information about the partitions' locations and sizes in an area known as the partition table that the operating system reads before any other part of the disk. Each partition then appears to the operating system as a distinct "logical" disk that uses part of the actual disk. System administrators use a program called a partition editor to create, resize, delete, and manipulate the partitions. Partitioning allows the use of different filesystems to be installed for different kinds of files. Separating user data from system data can prevent the system partition from becoming full and rendering the system unusable. Partitioning can also make backing up easier. A disadvantage is that it can be difficult to properly size partitions, resulting in having one partition with too much free space and another nearly totally allocated.

<span class="mw-page-title-main">GNU GRUB</span> Boot loader package

GNU GRUB is a boot loader package from the GNU Project. GRUB is the reference implementation of the Free Software Foundation's Multiboot Specification, which provides a user the choice to boot one of multiple operating systems installed on a computer or select a specific kernel configuration available on a particular operating system's partitions.

Logical block addressing (LBA) is a common scheme used for specifying the location of blocks of data stored on computer storage devices, generally secondary storage systems such as hard disk drives. LBA is a particularly simple linear addressing scheme; blocks are located by an integer index, with the first block being LBA 0, the second LBA 1, and so on.

The Macintosh Toolbox implements many of the high-level features of the Classic Mac OS, including a set of application programming interfaces for software development on the platform. The Toolbox consists of a number of "managers," software components such as QuickDraw, responsible for drawing onscreen graphics, and the Menu Manager, which maintain data structures describing the menu bar. As the original Macintosh was designed without virtual memory or memory protection, it was important to classify code according to when it should be loaded into memory or kept on disk, and how it should be accessed. The Toolbox consists of subroutines essential enough to be permanently kept in memory and accessible by a two-byte machine instruction; however it excludes core "kernel" functionality such as memory management and the file system. Note that the Toolbox does not draw the menu onscreen: menus were designed to have a customizable appearance, so the drawing code was stored in a resource, which could be on a disk.

<span class="mw-page-title-main">UEFI</span> Operating system and firmware specification

Unified Extensible Firmware Interface is a specification that defines the architecture of the platform firmware used for booting the computer hardware and its interface for interaction with the operating system. Examples of firmware that implement the specification are AMI Aptio, Phoenix SecureCore, TianoCore EDK II, InsydeH2O. UEFI replaces the BIOS which was present in the boot ROM of all personal computers that are IBM PC compatible, although it can provide backwards compatibility with the BIOS using CSM booting. Intel developed the original Extensible Firmware Interface (EFI) specification. Some of the EFI's practices and data formats mirror those of Microsoft Windows. In 2005, UEFI deprecated EFI 1.10.

HFS Plus or HFS+ is a journaling file system developed by Apple Inc. It replaced the Hierarchical File System (HFS) as the primary file system of Apple computers with the 1998 release of Mac OS 8.1. HFS+ continued as the primary Mac OS X file system until it was itself replaced with the Apple File System (APFS), released with macOS High Sierra in 2017. HFS+ is also one of the formats supported by the iPod digital music player.

<span class="mw-page-title-main">GUID Partition Table</span> Computer disk partitioning standard

The GUID Partition Table (GPT) is a standard for the layout of partition tables of a physical computer storage device, such as a hard disk drive or solid-state drive, using universally unique identifiers (UUIDs), which are also known as globally unique identifiers (GUIDs). Forming a part of the Unified Extensible Firmware Interface (UEFI) standard, it is nevertheless also used for some BIOSs, because of the limitations of master boot record (MBR) partition tables, which use 32 bits for logical block addressing (LBA) of traditional 512-byte disk sectors.

<span class="mw-page-title-main">Apple–Intel architecture</span> Unofficial name used for Macintosh models that use Intel x86 processors

The Apple–Intel architecture, or Mactel, is an unofficial name used for Macintosh personal computers developed and manufactured by Apple Inc. that use Intel x86 processors, rather than the PowerPC and Motorola 68000 ("68k") series processors used in their predecessors or the ARM-based Apple silicon SoCs used in their successors. As Apple changed the architecture of its products, they changed the firmware from the Open Firmware used on PowerPC-based Macs to the Intel-designed Extensible Firmware Interface (EFI). With the change in processor architecture to x86, Macs gained the ability to boot into x86-native operating systems, while Intel VT-x brought near-native virtualization with macOS as the host OS.

<span class="mw-page-title-main">Boot Camp (software)</span> Built-in macOS software to natively install Microsoft Windows on a Mac.

Boot Camp Assistant is a multi boot utility included with Apple Inc.'s macOS that assists users in installing Microsoft Windows operating systems on Intel-based Macintosh computers. The utility guides users through non-destructive disk partitioning of their hard disk drive or solid-state drive and installation of Windows device drivers for the Apple hardware. The utility also installs a Windows Control Panel applet for selecting the default boot operating system.

<span class="mw-page-title-main">TestDisk</span> Data recovery utility

TestDisk is a free and open-source data recovery utility that helps users recover lost partitions or repair corrupted filesystems. TestDisk can collect detailed information about a corrupted drive, which can then be sent to a technician for further analysis. TestDisk supports DOS, Microsoft Windows, Linux, FreeBSD, NetBSD, OpenBSD, SunOS, and MacOS. TestDisk handles non-partitioned and partitioned media. In particular, it recognizes the GUID Partition Table (GPT), Apple partition map, PC/Intel BIOS partition tables, Sun Solaris slice and Xbox fixed partitioning scheme. TestDisk uses a command line user interface. TestDisk can recover deleted files with 97% accuracy.

A volume boot record (VBR) is a type of boot sector introduced by the IBM Personal Computer. It may be found on a partitioned data storage device, such as a hard disk, or an unpartitioned device, such as a floppy disk, and contains machine code for bootstrapping programs stored in other parts of the device. On non-partitioned storage devices, it is the first sector of the device. On partitioned devices, it is the first sector of an individual partition on the device, with the first sector of the entire device being a Master Boot Record (MBR) containing the partition table.

<span class="mw-page-title-main">EFI system partition</span> Partition used by Unified Extensible Firmware Interface

The EFIsystem partition or ESP is a partition on a data storage device that is used by computers that have the Unified Extensible Firmware Interface (UEFI). When a computer is booted, UEFI firmware loads files stored on the ESP to start operating systems and various utilities.

In BSD-derived computer operating systems and in related operating systems such as SunOS, a disklabel is a record stored on a data storage device such as a hard disk that contains information about the location of the partitions on the disk. Disklabels were introduced in the 4.3BSD-Tahoe release. Disklabels are usually edited using the disklabel utility. In later versions of FreeBSD, this was renamed as bsdlabel.

The partition type in a partition's entry in the partition table inside a master boot record (MBR) is a byte value intended to specify the file system the partition contains or to flag special access methods used to access these partitions.

In computing, a rigid disk block (RDB) is the block on a hard disk where the Amiga series of computers store the disk's partition and filesystem information. The IBM's PC equivalent of the Amiga's RDB is the master boot record (MBR).

The BIOS boot partition is a partition on a data storage device that GNU GRUB uses on legacy BIOS-based personal computers in order to boot an operating system, when the actual boot device contains a GUID Partition Table (GPT). Such a layout is sometimes referred to as BIOS/GPT boot.

A master boot record (MBR) is a type of boot sector in the first block of partitioned computer mass storage devices like fixed disks or removable drives intended for use with IBM PC-compatible systems and beyond. The concept of MBRs was publicly introduced in 1983 with PC DOS 2.0.

References

  1. 1 2 3 "Technical Note TN2166 – Secrets of the GPT". Apple. Retrieved 2013-02-24. ...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...
  2. Mac OS: Technical overview of disk volume structures
  3. Apple Support Communities: Guid Partition or Apple Partition? (2012)
  4. MacTech Magazine: Apple's Transition from Apple Partition Map to the GUID Partition Table by Criss Myers
  5. Apple Mailing List: Subject: Re: Apple Partition Scheme or GUID Partition Scheme Archived 2009-04-06 at the Wayback Machine , Timothy Standing, 2006-04-30
  6. Apple Support Communities: Create a bootable clone using Disk Utility (2014): an example of problems trying to boot on an Intel Mac using an APM partitioned drive.
  7. Apple Support Communities: Running Mavericks + FCPX on External Boot Drive? (2014): OS X Mavericks does not boot from APM partitioned drives.
  8. OWC: Booting your Intel Mac to an APM-formatted drive, M. Christopher Stevens
  9. Mac OS X 10.5: Creating and maintaining a bootable "universal" external disk
  10. Rebe, René; Klaus, Susanne (2007). "Creating custom Linux solutions – Apple Partition Map". T2 System Development Environment. While the original intent was to handle various block sizes, in practice only 512 byte blocks are supported.
  11. "Yellow Dog Solutions – Attaching Firewire Disks to a Linux Box". Fixstars Corporation. Archived from the original on 2009-10-13. Retrieved 2013-02-24. 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.
  12. "IOApplePartitionScheme.h". Apple. 2009. Retrieved 2016-08-07.