Apple File System
|Full name||Apple File System|
|Introduced||March 27, 2017 (iOS), September 25, 2017 (macOS), with iOS 10.3, macOS 10.13|
|Partition identifier||7C3457EF-0000-11AA-AA11-00306543ECAC (GPT)|
|Directory contents||B-tree |
|Max. file size||8 EiB (9,223,372,036,854,775,808 bytes)|
|Max. number of files||9,223,372,036,854,775,808|
|Allowed characters in filenames||Unicode 9.0 encoded in UTF-8|
|Dates recorded||access, attributes modified, contents modified, created|
|Date range||January 1, 1970 – July 21, 2554|
|Date resolution||1 ns|
|File system permissions||Unix permissions, NFSv4 ACLs|
|Transparent compression||Partial (decmpfs)|
|Supported operating systems||macOS, iPadOS, iOS, tvOS, watchOS|
Apple File System (APFS) is a proprietary file system for macOS High Sierra (10.13) and later, iOS 10.3 and later, tvOS 10.2 and later, watchOS 3.2 and later, and all versions of iPadOS, developed and deployed by Apple Inc. It aims to fix core problems of HFS+ (also called Mac OS Extended), APFS's predecessor on these operating systems. Apple File System is optimized for flash and solid-state drive storage, with a primary focus on encryption.
History [ edit ]
Apple File System was announced at Apple'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 [ edit ]
The file system can be used on devices with relatively small or large amounts of storage. It uses 64-bit inode 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.
Clones [ edit ]
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.
Snapshots [ edit ]
Encryption [ edit ]
- 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 [ edit ]
Data integrity [ edit ]
Crash protection [ edit ]
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 [ edit ]
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 [ edit ]
Limitations [ edit ]
Unlike versions of HFS+ since Leopard, APFS has no support for hard links to directories. This is in line with many other modern file systems, but Time Machine still relies on them, so APFS is not yet an option for its backup volumes (as of macOS 10.15 Catalina).
Enumerating files, and any inode metadata in general, is much slower on APFS when it is located on a hard disk drive. 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 are performed when listing files, acceptable for SSDs but not HDDs.
Security issues [ edit ]
- 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.
Support [ edit ]
macOS [ edit ]
Since macOS High Sierra, all devices with flash storage are automatically converted to APFS. FileVault volumes are also converted. As of macOS 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
An experimental version of APFS, with some limitations, is available in macOS Sierra through the command line
diskutil utility. Among these limitations, it does not perform Unicode normalization 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, FileVault volumes, or Fusion Drives.
iOS, tvOS, and watchOS [ edit ]
Third-party utilities [ edit ]
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 implementation by Joachim Metz, libfsapfs, is released under GNU Lesser General Public License v3. It has been packaged into Debian and Ubuntu 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.
See also [ edit ]
References [ edit ]
- Hansen, K.H.; Toolan, F. (September 21, 2017). "Decoding the APFS file system". Digital Investigation. 22: 107–132. doi:10.1016/j.diin.2017.07.003. ISSN 1742-2876.
- "Volume Format Comparison". Apple Developer. Retrieved May 25, 2018.
- "Apple File System Guide / Frequently Asked Questions". Retrieved May 25, 2018.
- Bertin, René. "Compression and APFS". Github. Retrieved February 2, 2019.
- Apple Inc. "Apple File System Guide (Features)". Retrieved May 25, 2018.
- "tvOS 10.2". What's New in tvOS. Apple Inc.
- Warren, Tom (March 27, 2017). "Apple is upgrading millions of iOS devices to a new modern file system today". The Verge. Vox Media. Archived from the original on March 27, 2017. Retrieved March 27, 2017.
- Roger Fingas (June 13, 2016). "'Apple File System' will scale from Apple Watch to Macs, replace HFS+". Apple Insider. Archived from the original on July 23, 2016.
- Hutchinson, Lee (June 13, 2016). "Digging into APFS, Apple's new file system". Ars Technica UK. Retrieved June 15, 2016.
- Weintraub, Seth (June 13, 2016). "Apple File System (APFS) announced for 2017, scales 'from Apple Watch to Mac Pro' and focuses on encryption". 9to5Mac. Archived from the original on March 28, 2017. Retrieved March 27, 2017.
- Hutchinson, Lee (June 13, 2016). "New file system spotted in macOS Sierra [Updated]". Ars Technica. Condé Nast. Archived from the original on March 28, 2017. Retrieved March 27, 2017.
- Clover, Juli (March 27, 2017). "Apple Releases iOS 10.3 With Find My AirPods, APFS, App Store Review Tweaks and More". MacRumors. Archived from the original on March 27, 2017. Retrieved March 27, 2017.
- "Apple File System Reference"(PDF). Apple Developer.
- Alan Loughnane. "Updating your iPhone will give you one major benefit". joe.co.uk. Archived from the original on May 20, 2017.
- Adam Leventhal (June 19, 2016). "APFS in Detail: Data Integrity". Archived from the original on June 21, 2016.
- Søgaard, Jens K. "How do I enable transparent compression on APFS?". Ask Different. Retrieved November 13, 2019.
- "Archived copy"(PDF). Archived(PDF) from the original on October 23, 2016. Retrieved June 10, 2017. CS1 maint: archived copy as title (link)
- A ZFS developer’s analysis of the good and bad in Apple’s new APFS file systemArchived February 2, 2017, at the Wayback Machine
- Robin Harris (June 24, 2016). "Why Apple's APFS won't last 30 years". ZDNet.
- Adam Leventhal (June 19, 2016). "APFS in Detail: Overview". Retrieved October 1, 2017.
Leventhal, Adam H. (June 26, 2016). "A ZFS developer's analysis of the good and bad in Apple's new APFS file system". Ars Technica.
APFS right now is incompatible with Time Machine due to the lack of directory hard links, a fairly disgusting implementation that likely contributes to Time Machine's questionable reliability.
- "Disks you can use with Time Machine". Retrieved December 17, 2019.
- "An analysis of APFS enumeration performance on rotational hard drives". Carbon Copy Cloner. Retrieved January 8, 2020.
- "Uh Oh! Unified Logs in High Sierra (10.13) Show Plaintext Password for APFS Encrypted External Volumes via Disk Utility.app". mac4n6. Retrieved November 11, 2019.
- "Prepare for APFS in macOS High Sierra". Apple.com. September 7, 2017. Retrieved September 19, 2017.
- "macOS 10.14 Mojave: The Ars Technica review". arstechnica.com. September 25, 2018. Retrieved December 20, 2018.
- Trouton, Rich (September 26, 2017). "Using the macOS High Sierra OS installer's startosinstall tool to avoid APFS conversion". Der Flounder. Retrieved January 16, 2018.
- APFS’s “Bag of Bytes” Filenames
- APFS is currently unusable with most non-English languages – The Eclectic Light CompanyArchived June 8, 2017, at the Wayback Machine
- "How to Format a Drive With the APFS File System on macOS Sierra". Archived from the original on October 26, 2016. Retrieved October 26, 2016.
- "jakepetroules/Filesystem". GitHub. Retrieved March 29, 2017.
- "DiskWarrior 5.2 & Apple File System (APFS)". Retrieved June 28, 2020.
- "Paragon Software Group Releases Free Paragon APFS SDK Community Edition for Software Developers, OEMs, Forensic Experts". Paragon Software Group. GitHub
"libyal/libfsapfs". GitHub. November 7, 2019.
Library and tools to access the Apple File System (APFS)
- Ross, Alistair (February 23, 2019). "How to mount macOS APFS disk volumes in Linux". The Ultimate Linux Newbie Guide. (Github)
- "linux-apfs/linux-apfs-oot: APFS module for linux (out-of-tree repository)". GitHub. APFS for Linux. March 30, 2020.