[Update 03/27] iOS 10.3 Update with APFS Now Available to public
Without a file system, your Mac, iPhone, iPad or even your Apple Watch would not work. A file system is used by an operating system like macOS and iOS to read from and write to some sort of storage, whether it’s a huge hard disk drive or a speedy solid-state drive (SSD). All Macs currently use a file system called HFS+ (Hierarchical File System Plus), an outgrowth of the original Hierarchical File System that was introduced in 1985 with Mac System 2.1. With the roots of the file system now over 30 years old, Apple just announced a new file system called APFS (Apple File System) that will be shipped on all new Apple devices starting in 2017. As new versions of Apple operating systems roll out later in 2016 — macOS Sierra, iOS 10, tvOS 10 and watchOS 3 — existing devices will use APFS. (Note: You can read Apple’s APFS documentation here and watch an introduction video here.)
The newly re-named macOS Sierra will give Mac users their first look at APFS soon, but if you are planning to be part of the public beta test for the new operating system, there are some things you’ll want to look out for. APFS volumes currently cannot be used as startup disks, Time Machine volumes, or even as part of a Fusion Drive. File Vault encryption is out of the question since APFS has its own encryption scheme built-in. There are also issues dealing with the current, early version of APFS as it is case-sensitive. HFS+ is unlike many Unix-based file systems in that it can be configured to be case-insensitive, and running OS X with case-sensitive HFS+ has been known to cause issues. Our recommendation? Only try APFS from a beta version of macOS Sierra on an external volume that doesn’t have critical information on it.
APFS is what’s known as a modern file system, containing features that will make it usable on every device that Apple makes from the Apple Watch to the Mac Pro. Currently, iOS, watchOS and tvOS use HFS+ Case Sensitive (or what’s called HFSX) as a file system, but they’ll be using APFS as well. Let’s take a look at some of the new, modern features of APFS.
64-bit node number support
An inode is a data structure used to represent a file system object like a file or a directory, with each inode storing the attributes and disk block location(s) of the file system object’s data. These attributes can include object manipulation metadata like change, access or modify time, and owner and permission data. 64 bits can represent up to 18,446,744,073,709,551,615 objects, so Apple’s definitely looking at the future of big storage with APFS. By comparison, HFS+ can only address up to 4,294,967,295 objects.
Support for nanosecond time stamp granularity
File systems create a log of writes. HFS+ timestamps are only accurate to one second; that’s known as the granularity of the timestamps. APFS can track those timestamps with a granularity of one nanosecond — that’s one billionth of a second. This results in much better recovery from power-loss situations.
While APFS is writing data to a storage device, it makes a copy of metadata that describes the attributes of a file or folder. In the case of a power loss or severe system crash while the file system is writing to storage, crash protection ensures that what APFS writes to storage and writes to the the file system journal are completely synchronized.
Sparse file support
Sparse files are not supported by HFS+, and that’s not good. A sparse file is a computer file that tries to use file system space more efficiently when a file is mostly empty. With sparse files, storage is only allocated when needed, so large files can be created even if there’s insufficient free space available. APFS, like other modern file systems (many forms of Unix and NTFS), supports sparse files.
Trim is used by an operating system to tell an SSD which blocks of data aren’t in use and can be wiped internally. OS X originally supported Trim for Apple SSDs, and third-party SSDs often needed special utilities. The combination of macOS Sierra and APFS will support Trim for all SSDs. (Learn more: With An OWC SSD, There’s No Need For TRIM)
Sharing APFS volumes on a network requires use of SMB
Since way back in the Mac OS System 6 days, Apple has used a proprietary network protocol for sharing files over networks — Apple File Protocol or AFP. OS X supports a variety of file sharing network protocols in addition to AFP, including SMB (Server Message Block), NFS (Network File System), FTP and WebDAV. APFS volumes shared on a network will need to use the SMB protocol.
Mac encryption can be done several ways right now; through File Vault for full-disk encryption or through third-party applications for per-file encryption. APFS allows native encryption scalable to individual files depending on the level of security you desire. A file or directory can have no encryption, single-key encryption, and “multi-key encryption with per-key files and another key for sensitive metadata”. Since all Apple devices — not just the Mac — will base storage of data on APFS in the future, they’ll all have the option of providing encryption to files.
Fast directory sizing
Back in the days of slower (PowerPC-based) Macs, getting a read on the amount of available disk space could take a while; doing a “Get Info” on a volume could take minutes while the Mac did stat calls to get an answer on just how much space was being used. Faster Macs have made that wait a lot shorter (seconds with a fast Mac), but APFS fast directory sizing will be almost instantaneous. The new file system gives macOS a method of querying the size of a directory and its child objects very quickly.
APFS can be asked to create a read-only instance of the file system — a snapshot — then add changed blocks to the snapshot as the file system’s state diverges from the original snapshot. What’s interesting is that this may result in a completely new way for how Time Machine will work. Currently, Apple’s OS X backup scheme uses an old-fashioned system of hard links that are built and maintained by Time Machine. A future version of Time Machine — perhaps in macOS Sierra — would just capture snapshots instead.
While snapshots are read-only, clones are read/write. APFS can create file or directory clones instantly without waiting for data to be copied. A clone of a directory or file stores all changes made between it and the original object, making the clone an editable, writable copy of a directory or file at any point in time. Clones will most likely be used by developers to capture document revisions and do versioning.
Enterprise disk arrays have been able to do write coalescing for a long time, which gives file systems some leeway in how they commit data to storage. APFS will be able to take a number of short and potentially unrelated writes, then combine them into one long write that uses the physical storage in a much more efficient manner.
One of the more intriguing demonstrations during Tuesday’s APFS presentation was about space sharing, which allows multiple volumes to be created out of the same physical storage space. Rather than pre-sizing a partition before using it, it’s possible to create a volume that grows as space is added to it. Additional physical storage can be added later to keep up with volume growth without having to resize the original logical volume. This may have long-term ramifications for how macOS works with RAID storage.
Other than what we’ve heard about APFS in the WWDC presentation, we don’t know much about how it will affect the world of Mac storage. As APFS development continues alongside the various beta versions of macOS Sierra, we’ll provide more information about the new, modern macOS file system.
[Update 03/27] Have you noticed a difference in performance now that APFS is installed in iOS 10.3? Let us know in the comments.