Apple File System
   HOME

TheInfoList



OR:

Apple File System (APFS) is a proprietary file system developed and deployed by Apple Inc. for
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
Sierra (10.12.4) and later, iOS 10.3, tvOS 10.2,
watchOS watchOS is the operating system of the Apple Watch, developed by Apple Inc., Apple. It is based on iOS, the operating system used by the iPhone, and has many similar features. It was released on April 24, 2015, along with the Apple Watch, the o ...
3.2, and all versions of iPadOS. It aims to fix core problems of HFS+ (also called Mac OS Extended), APFS's predecessor which had been in use since 1998. APFS is optimized for solid-state drive storage and supports
encryption In Cryptography law, cryptography, encryption (more specifically, Code, encoding) is the process of transforming information in a way that, ideally, only authorized parties can decode. This process converts the original representation of the inf ...
, snapshots, and improved handling of
metadata Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive ...
integrity.


History

Apple File System was announced at
Apple An apple is a round, edible fruit produced by an apple tree (''Malus'' spp.). Fruit trees of the orchard or domestic apple (''Malus domestica''), the most widely grown in the genus, are agriculture, cultivated worldwide. The tree originated ...
's developers’ conference (WWDC) in June 2016 as a replacement for HFS+, which had been in use since 1998. APFS was released for 64-bit iOS devices on March 27, 2017, with the release of iOS 10.3, and for macOS devices on September 25, 2017, with the release of macOS 10.13. Apple released a partial specification for APFS in September 2018 which supported read-only access to Apple File Systems on unencrypted, non-Fusion storage devices. The specification for software encryption was documented later.


Design

The file system can be used on devices with relatively small or large amounts of storage. It uses 64-bit
inode An inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block locations of the object's data. File-system object attribu ...
numbers, and allows for more secure storage by using a technology called Data Protection. The APFS code, like the HFS+ code, uses the TRIM command for better space management and performance. It may increase read-write speeds on iOS and macOS, as well as space on iOS devices, due to the way APFS calculates available data.


Partition scheme

APFS uses the GPT partition scheme. Within the GPT scheme are one or more APFS containers (partition type GUID is ). Within each container there are one or more APFS volumes, all of which share the allocated space of the container, and each volume may have APFS volume roles.
macOS Catalina macOS Catalina (version 10.15) is the sixteenth software versioning, major release of macOS, Apple Inc.'s desktop operating system for Macintosh computers. It is the successor to macOS Mojave and was announced at WWDC 2019 on June 3, 2019 and ...
(macOS 10.15) introduced the APFS volume group, which are groups of volumes that Finder displays as one volume. APFS firmlinks lie between
hard link In computing, a hard link is a directory entry (in a Directory (computing), directory-based file system) that associates a name with a Computer file, file. Thus, each file must have at least one hard link. Creating additional hard links for a fil ...
s and soft links and link between volumes. In macOS Catalina the volume role (usually named "Macintosh HD") became read-only, and in
macOS Big Sur macOS Big Sur (version 11) is the seventeenth software versioning, major release of macOS, Apple Inc., Apple's operating system for Macintosh computers. It was announced at Apple's Worldwide Developers Conference (WWDC) on June 22, 2020, and w ...
(macOS 11) it became a signed system volume (SSV) and only volume snapshots are mounted. The volume role (usually named "Macintosh HD - Data") is used as an overlay or shadow of the volume, and both the and volumes are part of the same volume group and shown as one in Finder.


Clones

Clones allow the operating system to make efficient file copies on the same volume without occupying additional storage space. Changes to a cloned file are saved as delta extents, reducing storage space required for document revisions and copies. There is, however, no interface to mark two copies of the same file as clones of the other, or for other types of data deduplication. The feature is automatically available when you copy any files using the Finder application, which is
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
's default
file manager A file manager or file browser is a computer program that provides a user interface to manage computer files, files and folder (computing), folders. The most common Computer file#Operations, operations performed on files or groups of files incl ...
, but not when using the cp command. To do that on the command-line, the cp utility on macOS has a -c parameter that allows it to use the clonefile
system call In computing, a system call (syscall) is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services (for example, accessing a hard disk drive ...
.


Snapshots

APFS volumes support snapshots for creating a point-in-time, read-only instance of the file system.


Encryption

Apple File System natively supports full disk encryption, and file encryption with the following options: * no encryption * single-key encryption * multi-key encryption, where each file is encrypted with a separate key, and
metadata Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive ...
is encrypted with a different key.


Increased maximum number of files

APFS supports 64-bit inode numbers, supporting over 9 quintillion files (263) on a single volume.


Data integrity

Apple File System uses checksums to ensure
data integrity Data integrity is the maintenance of, and the assurance of, data accuracy and consistency over its entire Information Lifecycle Management, life-cycle. It is a critical aspect to the design, implementation, and usage of any system that stores, proc ...
for
metadata Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive ...
but not for the actual user data, relying instead on error-correcting code (ECC) mechanisms in the storage hardware.


Crash protection

Apple File System is designed to avoid metadata corruption caused by system crashes. Instead of overwriting existing metadata records in place, it writes entirely new records, points to the new ones and then releases the old ones, an approach known as redirect-on-write. This avoids corrupted records containing partial old and partial new data caused by a crash that occurs during an update. It also avoids having to write the change twice, as happens with an HFS+ journaled file system, where changes are written first to the journal and then to the catalog file.


Compression

APFS supports transparent compression on individual files using Deflate (Zlib), LZVN (libFastCompression), and LZFSE. All three are Lempel-Ziv-type algorithms. This feature is inherited from HFS+, and is implemented with the same AppleFSCompression / decmpfs system using resource forks or extended attributes. As with HFS+, the transparency is broken for tools that do not use decmpfs-wrapped routines.


Space sharing

APFS adds the ability to have multiple logical drives (referred to as volumes) in the same container where free space is available to all volumes in that container (block device).


Limitations

While APFS includes numerous improvements relative to its predecessor, HFS+, a number of limitations have been noted.


Limited integrity checks for user data

APFS does not provide checksums for user data. It also does not take advantage of byte-addressable non-volatile random-access memory.


Performance on hard disk drives

Enumerating files, and any
inode An inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block locations of the object's data. File-system object attribu ...
metadata in general, is much slower on APFS when it is located on a
hard disk drive A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating hard disk drive platter, pla ...
(HDD). This is because instead of storing
metadata Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive ...
at a fixed location like HFS+ does, APFS stores them alongside the actual file data. On SSDs, this fragmentation of metadata is inconsequential due to their lack of moving parts, but on HDDs, it leads to substantial performance degradation as the drive’s read/write heads must physically seek out scattered data fragments. Besides that, a key feature of APFS is " copy-on-write," which allows for rapid file duplication by creating references to the original data rather than copying it outright. This feature enables functionalities like snapshots and quick file copies. However, when files are modified after being copied, APFS creates new extents ( data blocks) for the changes, leading to more fragmentation over time. This issue is exacerbated with applications like Time Machine, which creates multiple versions of files, further increasing fragmentation and slowing
performance A performance is an act or process of staging or presenting a play, concert, or other form of entertainment. It is also defined as the action or process of carrying out or accomplishing an action, task, or function. Performance has evolved glo ...
. As a result, APFS is generally not recommended for use on HDDs, particularly for workloads involving frequent file modifications, copying, or snapshot usage.


Compatibility with Time Machine prior to macOS 11

Unlike HFS+, APFS does not support
hard link In computing, a hard link is a directory entry (in a Directory (computing), directory-based file system) that associates a name with a Computer file, file. Thus, each file must have at least one hard link. Creating additional hard links for a fil ...
s to directories. Since the version of the Time Machine backup software included in Mac OS X 10.5 (Leopard) through macOS 10.15 (Catalina) relied on hard links to directories, APFS was initially not a supported option for its backup volumes. This limitation was overcome starting in macOS 11 Big Sur, wherein APFS is now the default file system for new Time Machine backups (existing HFS+-formatted backup drives are also still supported). macOS Big Sur's implementation of Time Machine in conjunction with APFS-formatted drives enables "faster, more compact, and more reliable backups" than were possible with HFS+-formatted backup drives.


Security issues

* In March 2018, the APFS driver in High Sierra was found to have a bug that causes the disk encryption password to be logged in plaintext. * In January 2021, the APFS driver in iOS < 14.4, macOS < 11.2, watchOS < 7.3, and tvOS < 14.4 was found to have a bug that allowed a local user to read arbitrary files, regardless of their permissions.


Support


macOS

An experimental version of APFS, with some limitations, is provided in macOS Sierra 10.12.4. It is available through the command line diskutil utility. Among these limitations, it does not perform
Unicode normalization Unicode equivalence is the specification by the Unicode character (computing), character encoding standard that some sequences of code points represent essentially the same character. This feature was introduced in the standard to allow compatibi ...
while HFS+ does, leading to problems with languages other than English. Drives formatted with Sierra’s version of APFS may also not be compatible with later versions of macOS or APFS, and the Sierra version of APFS cannot be used with Time Machine, FileVault volumes, or Fusion Drives. Since macOS 10.13 High Sierra, all devices with flash storage are automatically converted to APFS. As of macOS 10.14 Mojave, Fusion Drives and hard disk drives are also upgraded on installation. The primary user interface to upgrade does not present an option to opt out of this conversion, and devices formatted with the High Sierra version of APFS will not be readable in previous versions of macOS. Users can disable APFS conversion by using the installer's startosinstall utility on the command line and passing --converttoapfs NO. FileVault volumes are not converted to APFS as of macOS Big Sur 11.2.1. Instead macOS formats external FileVault drives as CoreStorage Logical Volumes formatted with Mac OS Extended (Journaled). FileVault drives can be optionally encrypted.


iOS, tvOS, and watchOS

iOS 10.3, tvOS 10.2, and watchOS 3.2 convert the existing HFSX file system to APFS on compatible devices.


Third-party utilities

Despite the ubiquity of APFS volumes in today's Macs and the format's 2016 introduction, third-party repair utilities continue to have notable limitations in supporting APFS volumes, due to Apple's delayed release of complete documentation. According to Alsoft, the maker of DiskWarrior, Apple's 2018 release of partial APFS format documentation has delayed the creation of a version of DiskWarrior that can safely rebuild APFS disks. Competing products, including MicroMat's TechTool and Prosoft's Drive Genius, are expected to increase APFS support as well. Paragon Software Group has published a software development kit under the 4-Clause BSD License that supports read-only access of APFS drives. An independent read-only
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
implementation by Joachim Metz, libfsapfs, is released under GNU Lesser General Public License v3. It has been packaged into
Debian Debian () is a free and open-source software, free and open source Linux distribution, developed by the Debian Project, which was established by Ian Murdock in August 1993. Debian is one of the oldest operating systems based on the Linux kerne ...
, Fedora Linux, Rocky Linux, Red Hat Enterprise Linux and
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
software repositories. Both are command-line tools that do not expose a normal filesystem driver interface. There is a Filesystem in Userspace (FUSE) driver for Linux called apfs-fuse with read-only access. An "APFS for Linux" project is working to integrate APFS support into the Linux kernel. A commercial product, Paragon's APFS for Windows, allows for read and write support to APFS volumes in all versions of Windows from Windows 7 through Windows 11 and Windows Server 2008 R2 through Windows Server 2022, but it is unable to format or verify APFS volumes, and it cannot read APFS volumes which are hardware-encrypted against the Apple T2 security chip.


See also

* Comparison of file systems


Notes

:A.Disputed


References


External links

* Apple Developer
Apple File System Guide
* Apple Developer
Apple File System Reference
* WWDC 2016
Introduction of APFS
by Apple software engineers Dominic Giampaolo and Eric Tamura
Detailed Overview of APFS
by independent file system developer Adam Leventhal {{macOS 2017 software Apple Inc. file systems Computer file systems Disk file systems Flash file systems IOS MacOS