Apple File System (APFS) is a
proprietary file system
In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one lar ...
developed and deployed by
Apple Inc.
Apple Inc. is an American multinational technology company headquartered in Cupertino, California, United States. Apple is the largest technology company by revenue (totaling in 2021) and, as of June 2022, is the world's biggest company ...
for
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
Sierra (10.12.4) and later,
iOS
iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that powers many of the company's mobile devices, including the iPhone; the term also include ...
10.3 and later,
tvOS
tvOS (formerly known as Apple TV Software) is an operating system developed by Apple Inc. for the Apple TV, a digital media player. In the first-generation Apple TV, Apple TV Software was based on Mac OS X. Starting with the second-generatio ...
10.2 and later,
watchOS
watchOS is the operating system of the Apple Watch, developed by Apple Inc. 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 only ...
3.2 and later,
and all versions of
iPadOS
iPadOS is a mobile operating system developed by Apple Inc. for its iPad line of tablet computers. It is a rebranded variant of iOS, the operating system used by Apple's iPhones, renamed to reflect the diverging features of the two product ...
.
It aims to fix
core problems of
HFS+
HFS Plus or HFS+ (also known as Mac OS Extended or HFS Extended) 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. ...
(also called Mac OS Extended), APFS's predecessor on these operating systems. APFS is optimized for
solid-state drive
A solid-state drive (SSD) is a solid-state storage device that uses integrated circuit assemblies to store data persistently, typically using flash memory, and functioning as secondary storage in the hierarchy of computer storage. It i ...
storage and supports
encryption
In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can dec ...
,
snapshots
Snapshot, snapshots or snap shot may refer to:
* Snapshot (photography), a photograph taken without preparation
Computing
* Snapshot (computer storage), the state of a system at a particular point in time
* Snapshot (file format) or SNP, a fil ...
, and increased data integrity, among other capabilities.
History
Apple File System was announced at
Apple
An apple is an edible fruit produced by an apple tree (''Malus domestica''). Apple trees are cultivated worldwide and are the most widely grown species in the genus '' Malus''. The tree originated in Central Asia, where its wild ances ...
's
developers conference (WWDC) in June 2016 as a replacement for
HFS+
HFS Plus or HFS+ (also known as Mac OS Extended or HFS Extended) 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. ...
, which had been in use since 1998.
APFS was released for
64-bit
In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit CPUs and ALUs are those that are based on processor registers, address buses, or data buses of that size. A comp ...
iOS
iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that powers many of the company's mobile devices, including the iPhone; the term also include ...
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
The 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. 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 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 released to the p ...
(macOS 10.15) introduced the APFS volume group, which are groups of volumes that
Finder
Finder may refer to:
* Finder (surname)
* Finder (software), part of the Apple Macintosh operating system
* ''Finder'' (comics), a comic book series by Carla Speed McNeil
* ''Finder'' (novel), a 1994 novel by Emma Bull
* Finder Wyvernspur, a fi ...
displays as one volume. APFS firmlinks lie between
hard link
In computing, a hard link is a directory entry (in a directory-based file system) that associates a name with a file. Thus, each file must have at least one hard link. Creating additional hard links for a file makes the contents of that file ac ...
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.'s operating system for Macintosh computers. It was announced at Apple's Apple Worldwide Developers Conference, Worldwide Developers Conferen ...
(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
In computing, data deduplication is a technique for eliminating duplicate copies of repeating data. Successful implementation of the technique can improve storage utilization, which may in turn lower capital expenditure by reducing the overall amou ...
.
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
Disk encryption is a technology which protects information by converting it into unreadable code that cannot be deciphered easily by unauthorized people. Disk encryption uses disk encryption software or hardware to encrypt every bit of data that g ...
,
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 is encrypted with a different key.
Increased maximum number of files
APFS supports 64-bit
inode numbers, supporting over 9 quintillion files (2
63) on a single volume.
Data integrity
Apple File System uses
checksum
A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. By themselves, checksums are often used to verify dat ...
s to ensure
data integrity
Data integrity is the maintenance of, and the assurance of, data accuracy and consistency over its entire life-cycle and is a critical aspect to the design, implementation, and usage of any system that stores, processes, or retrieves data. The ter ...
for metadata.
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
Non-volatile random-access memory (NVRAM) is random-access memory that retains data without applied power. This is in contrast to dynamic random-access memory (DRAM) and static random-access memory (SRAM), which both maintain data only for as lon ...
.
Performance on hard disk drives
Enumerating files, and any
inode
The 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 platters coated with magn ...
. This is because instead of storing metadata at a fixed location like HFS+ does, APFS stores them alongside the actual file data. This fragmentation of metadata means more
seeks
Seeks is a free and open-source project licensed under the GNU Affero General Public License version 3 (AGPL-3.0-or-later). It exists to create an alternative to the current market-leading search engines, driven by user concerns rather than corp ...
are performed when listing files, acceptable for SSDs but not HDDs.
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-based file system) that associates a name with a file. Thus, each file must have at least one hard link. Creating additional hard links for a file makes the contents of that file ac ...
s to directories.
Since the version of the
Time Machine
Time travel is the concept of movement between certain points in time, analogous to movement between different points in space by an object or a person, typically with the use of a hypothetical device known as a time machine. Time travel is a ...
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+
HFS Plus or HFS+ (also known as Mac OS Extended or HFS Extended) 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. ...
-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
Limited, experimental support for APFS was first introduced in
macOS Sierra
macOS Sierra (version 10.12) is the thirteenth major release of macOS (formerly known as and ), Apple Inc.'s desktop and server operating system for Macintosh computers. The name "macOS" stems from the intention to uniform the operating sys ...
10.12.4. Since
macOS 10.13 High Sierra, all devices with flash storage are automatically converted to APFS.
As of
macOS 10.14 Mojave,
Fusion Drive
Fusion Drive is a type of hybrid drive technology created by Apple Inc. It combines a hard disk drive with a NAND flash storage ( solid-state drive of 24 GB or more) and presents it as a single Core Storage managed logical volume with the ...
s 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.
An experimental version of APFS, with some limitations, is available in
macOS Sierra
macOS Sierra (version 10.12) is the thirteenth major release of macOS (formerly known as and ), Apple Inc.'s desktop and server operating system for Macintosh computers. The name "macOS" stems from the intention to uniform the operating sys ...
through the command line
diskutil
utility. Among these limitations, it does not perform
Unicode normalization
Unicode equivalence is the specification by the Unicode character encoding standard that some sequences of code points represent essentially the same character. This feature was introduced in the standard to allow compatibility with preexisting st ...
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 future versions of macOS or the final version of APFS, and the Sierra version of APFS cannot be used with
Time Machine
Time travel is the concept of movement between certain points in time, analogous to movement between different points in space by an object or a person, typically with the use of a hypothetical device known as a time machine. Time travel is a ...
, FileVault volumes, or Fusion Drives.
iOS, tvOS, and watchOS
iOS 10.3
iOS 10 is the tenth major release of the iOS mobile operating system developed by Apple Inc., being the successor to iOS 9. It was announced at the company's Worldwide Developers Conference on June 13, 2016, and was released on September 13, ...
,
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
A software development kit (SDK) is a collection of software development tools in one installable package. They facilitate the creation of applications by having a compiler, debugger and sometimes a software framework. They are normally specific ...
under the 4-Clause
BSD License
BSD licenses are a family of permissive free software licenses, imposing minimal restrictions on the use and distribution of covered software. This is in contrast to copyleft licenses, which have share-alike requirements. The original BSD li ...
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 the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
implementation by Joachim Metz, libfsapfs, is released under
GNU Lesser General Public License
The GNU Lesser General Public License (LGPL) is a free-software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate a software component released under the LGPL into their own ...
v3. It has been packaged into
Debian
Debian (), also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of De ...
,
Fedora Linux
Fedora Linux is a Linux distribution developed by the Fedora Project. Fedora contains software distributed under various free and open-source licenses and aims to be on the leading edge of open-source technologies. Fedora is the upstream (softwa ...
,
Rocky Linux
Rocky Linux is a Linux distribution developed by Rocky Enterprise Software Foundation, which is a privately owned benefit corporation that describes itself as a "self imposed not-for-profit". It is intended to be a downstream, complete binary-com ...
,
Red Hat Enterprise Linux
Red Hat Enterprise Linux (RHEL) is a Commercial software, commercial Open-source software, open-source Linux distribution developed by Red Hat for the commerce, commercial market. Red Hat Enterprise Linux is released in server versions for x86-6 ...
and
Ubuntu
Ubuntu ( ) is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in three editions: '' Desktop'', '' Server'', and ''Core'' for Internet of things devices and robots. All th ...
software repositories. Both are command-line tools that do not expose a normal filesystem driver interface. There is a
Filesystem in Userspace
Filesystem in Userspace (FUSE) is a software interface for Unix and Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code. This is achieved by running file system code in u ...
(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.
See also
*
Comparison of file systems
The following tables compare general and technical information for a number of file systems.
General information
Limits
Metadata
Features File capabilities
Block capabilities
Note that in addition to the below table, blo ...
References
External links
*
Apple Developer
Apple Developer (formerly Apple Developer Connection) is Apple Inc.'s website for software development tools, application programming interfaces (APIs), and technical resources. It contains resources to help software developers write software for ...
Apple File System Guide* Apple Developer
Apple File System Reference*
WWDC
The Worldwide Developers Conference (WWDC) is an information technology conference held annually by Apple Inc. The conference is usually held at Apple Park in California. The event is usually used to showcase new software and technologies in t ...
2016
Introduction of APFSby Apple software engineers
Dominic Giampaolo
Dominic P. Giampaolo is a software developer who helped develop the Be File System for the Be Operating System (BeOS) and currently works at Apple Inc.
After graduating from Lewiston High School in Lewiston, Maine in 1987, he started studyin ...
and Eric Tamura
Detailed Overview of APFSby independent file system developer Adam Leventhal
{{macOS
2017 software
Apple Inc. file systems
Computer file systems
Disk file systems
Flash file systems
IOS
MacOS