ArticleslgStudy

computer science

Apple File System

Apple File System is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Apple File System rather than just read about it. In short: Apple File System (APFS) is a proprietary file system developed and deployed by Apple Inc. for macOS Sierra (10.12.4) and later, iOS 10.3, tvOS 10.2, watchOS 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.

Key takeaways

  • Apple File System belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Apple File System to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Apple File System from memory before moving on to harder problems.

Reference excerpt

Apple File System (APFS) is a proprietary file system developed and deployed by Apple Inc. for macOS Sierra (10.12.4) and later, iOS 10.3, tvOS 10.2, watchOS 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, snapshots, and improved handling of metadata integrity.

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. 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 that 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 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 7C3457EF-0000-11AA-AA11-00306543ECAC). 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 10.15) introduced the APFS volume group, which are groups of volumes that Finder displays as one volume. APFS firmlinks lie between hard links and soft links, and link between volumes. In macOS Catalina the System volume role (usually named "Macintosh HD") became read-only, and in macOS Big Sur (macOS 11) it became a signed system volume (SSV) and only volume snapshots are mounted. The Data volume role (usually named "Macintosh HD - Data") is used as an overlay or shadow of the System volume, and both the System and Data 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 a user copies any files using the Finder application, which is macOS's default file manager, 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.

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 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 for metadata 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 metadata in general, is much slower on APFS when it is located on a hard disk drive (HDD). This is because instead of storing metadata 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. 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. As a result, APFS is generally not recommended for use on HDDs, particularly for workloads involving frequent file modifications, copying, or snapshot usage.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Apple File System

Start with the simplest possible case. Write down what Apple File System claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Apple File System before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Apple File System ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Apple File System

In research
Apple File System appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Apple File System in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Apple File System is common in secondary-school and first-year university syllabi. It links to neighbouring topics 2017 software, Apple Inc. file systems, Computer file systems, so understanding it makes those chapters shorter.
In everyday life
Look for Apple File System outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Apple File System” →

How to study Apple File System in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Apple File System means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Apple File System out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Apple File System in simple terms?

Apple File System (APFS) is a proprietary file system developed and deployed by Apple Inc. for macOS Sierra (10.12.4) and later, iOS 10.3, tvOS 10.2, watchOS 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 us…

Why does Apple File System matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Apple File System?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Apple File System.

Tags

  • 2017 software
  • Apple Inc. file systems
  • Computer file systems
  • Disk file systems
  • Flash file systems
  • IOS
  • MacOS

Keep exploring