Apple File System

From Infogalactic: the planetary knowledge core
Jump to: navigation, search
APFS
Developer(s) Apple Inc.
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)
Structures
Directory contents B-tree[1]
Limits
Max. file size 8 EiB (263 bytes)[2]
Max. number of files 263 [2]
Allowed characters in filenames Unicode 9.0 encoded in UTF-8[3]
Features
Dates recorded access, attributes modified, contents modified, created
Date range January 1, 1970 – July 21, 2554[1]
Date resolution 1 ns[2]
File system permissions Unix permissions, NFSv4 ACLs
Transparent compression Yes (decmpfs)[4]
Transparent encryption Yes[5]
Copy-on-write Yes[3][5]
Other
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,[6] and watchOS 3.2 and later,[7] developed and deployed by Apple Inc.[8][9] 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.[10][11]

History

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

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

Design

The file system can be used on devices with relatively small or large amounts of storage. It uses 64-bit inode numbers,[2] 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,[7] as well as space on iOS devices, due to the way APFS calculates available data.[14]

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

Apple File System supports snapshots for creating a point-in-time, read-only instance of the file system.[9]

Encryption

Apple File System natively supports full disk encryption,[2] 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.[9]

Increased maximum number of files

APFS supports 64-bit inode numbers, supporting over 9 quintillion files on a single volume.[2][5]

Data integrity

Apple File System uses checksums to ensure data integrity for metadata.[15]

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

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

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).[17]

Limitations

Apple File System does not provide checksums for user data.[18] It also does not take advantage of byte-addressable non-volatile random-access memory,[19][20]

Unlike versions of HFS+ since Leopard, APFS has no support for hard links to directories.[3][21] 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).[22][21]

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

Security issues

  • In March 2018, the APFS driver in High Sierra was revealed to include a bug that causes the disk encryption password to be logged in plaintext.[24]

Support

macOS

Since macOS High Sierra, all devices with flash storage are automatically converted to APFS.[25] FileVault volumes are also converted. As of macOS Mojave, Fusion Drives and hard disk drives are also upgraded on installation.[26] 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.[25] Users can disable APFS conversion by using the installer's startosinstall utility on the command line and passing --converttoapfs NO.[27]

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,[28] leading to problems with languages other than English.[29] 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.[30]

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

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 the popular DiskWarrior, Apple's 2018 release of finalized APFS format documentation will enable safe rebuilding of APFS disks in future versions of its flagship product.[32] 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.[33] 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.[34] 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 fuse-apfs with read-only access.[35]

See also

References

  1. 1.0 1.1 Lua error in package.lua at line 80: module 'strict' not found.
  2. 2.0 2.1 2.2 2.3 2.4 2.5 Lua error in package.lua at line 80: module 'strict' not found.
  3. 3.0 3.1 3.2 Lua error in package.lua at line 80: module 'strict' not found.
  4. Lua error in package.lua at line 80: module 'strict' not found.
  5. 5.0 5.1 5.2 Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.
  7. 7.0 7.1 7.2 7.3 Lua error in package.lua at line 80: module 'strict' not found.
  8. Lua error in package.lua at line 80: module 'strict' not found.
  9. 9.0 9.1 9.2 9.3 Lua error in package.lua at line 80: module 'strict' not found.
  10. 10.0 10.1 Lua error in package.lua at line 80: module 'strict' not found.
  11. 11.0 11.1 Lua error in package.lua at line 80: module 'strict' not found.
  12. 12.0 12.1 Lua error in package.lua at line 80: module 'strict' not found.
  13. Lua error in package.lua at line 80: module 'strict' not found.
  14. Lua error in package.lua at line 80: module 'strict' not found.
  15. 15.0 15.1 Lua error in package.lua at line 80: module 'strict' not found.
  16. Lua error in package.lua at line 80: module 'strict' not found.
  17. Lua error in package.lua at line 80: module 'strict' not found.
  18. A ZFS developer’s analysis of the good and bad in Apple’s new APFS file system Archived February 2, 2017, at the Wayback Machine
  19. Why Apple's APFS won't last 30 years Archived April 6, 2017, at the Wayback Machine
  20. Lua error in package.lua at line 80: module 'strict' not found.
  21. 21.0 21.1 Lua error in package.lua at line 80: module 'strict' not found.
  22. Lua error in package.lua at line 80: module 'strict' not found.
  23. Lua error in package.lua at line 80: module 'strict' not found.
  24. Lua error in package.lua at line 80: module 'strict' not found.
  25. 25.0 25.1 Lua error in package.lua at line 80: module 'strict' not found.
  26. Lua error in package.lua at line 80: module 'strict' not found.
  27. Lua error in package.lua at line 80: module 'strict' not found.
  28. APFS’s “Bag of Bytes” Filenames
  29. APFS is currently unusable with most non-English languages – The Eclectic Light Company Archived June 8, 2017, at the Wayback Machine
  30. Lua error in package.lua at line 80: module 'strict' not found.
  31. Lua error in package.lua at line 80: module 'strict' not found.
  32. Alsoft DiskWarrior: Mojave and Apple File System (APFS)
  33. Lua error in package.lua at line 80: module 'strict' not found. GitHub
  34. Lua error in package.lua at line 80: module 'strict' not found.
  35. Lua error in package.lua at line 80: module 'strict' not found. (Github)

External links