Zit Seng's Blog

A Singaporean's technology and lifestyle blog

Apple Has New File System

For most people, file systems are boring stuff. It’s about how stuff gets organised in a disk. It’s not about how you organise your stuff, but how your computer puts your stuff in a hard disk drive, SSD, flash drive or other storage media. Why would you care? As long as whatever you saved into them, is there when you want them?

Apple’s new file system, simply named Apple File System (APFS), looks to be quite different. Excitingly different. Exciting, probably, even for techies who hadn’t cared very much about file systems previously.

Did you care about FAT16? When FAT16 became FAT32? When exFAT came about? Do you know what are the key features of NTFS? Most people don’t care. You probably know which is newer, or better, than which other. But you don’t really know what they were about.

APFS, however, isn’t just an incremental change, or feature enhancement, of some other existing file system. It’s not just an update to HFS+, the existing file system used on Macs. It’s a revolutionary change. Apple calls it the next-generation file system for apple products, and I think it truly deserves to be called next-generation.

Now, before we get too excited and carried away about APFS, what with the upcoming macOS Sierra expected in a few months, let’s just be reminded that APFS is marked as a developer preview, and is scheduled to ship only in 2017. You’ll see it in macOS Sierra, but Apple recommends you test APFS on an external volume that doesn’t contain anything important.

APFS will eventually replace the current HFS+, but not just yet with macOS Sierra. However, users can start to familiarise themselves with the features of APFS in a few months’ time. APFS isn’t backward compatible with HFS+, so it’s likely you’ll have to start with a fresh volume, not upgrade an existing HFS+ one to APFS.

The first thing about APFS is that it will support all Apple’s products. Some day in the future, you’ll find all your watchOS, tvOS, iOS and macOS all running the same file system, APFS.

APFS is designed to work with both flash storage as well as SSD storage. Many file systems were designed before flash and SSD storage. A new file system presents an opportunity to design properly for these new storage types. One key feature, for example, is about auto-trimming to prevent devices using flash from slowing over time. Apple’s new APFS guide says:

On APFS, Trim operations are issued asynchronously from when files are deleted or free space is reclaimed, which ensures that these operations are only performed once metadata changes are persisted to stable storage

Other important updates include native encryption support. Now, File Vault 2 perhaps sounds quite native already. But no, APFS will really have encryption baked into it.

APFS supports encryption natively. You can choose one of the following encryption models for each volume in a container: no encryption, single-key encryption, or multi-key encryption with per-file keys for file data, and a separate key for sensitive metadata

Something that may be a little bit difficult to grasp at first is about how space is divided and allocated to file systems. You’re probably familiar with drive partitions. You divide out a big hard disk to create multiple logical drives. The problem with this scheme is that the division is fixed form the beginning, and it is not possible (or difficult, at best) to adjust the division thereafter. For example, if you have a 1 TB hard disk drive which you divide into two equal parts, each 500 GB, and create a logical volume (or C: and D: as Windows users might be more familiar), you’re stuck with this sizing. If C: is running out of space, while D: is under used, you cannot say move some of the free space from the latter to the former.

It’ll be different with APFS. The basic allocation unit is a container, which corresponds to a disk partition. Within the container, you can create multiple volumes, or file systems. The space given to each file system is flexible. Basically, each file system within the same container share all the space inside that container.

Some of you might perhaps be thinking about ZFS, that it was rumoured once upon a time that ZFS would come to the Mac. It didn’t happen, or perhaps it will be after all, in the form of APFS. Well, APFS isn’t ZFS. Whether Apple borrowed some ZFS ideas to make APFS, of course, is anybody’s guess.

Moving on, APFS supports file cloning. Cloning allows the system to make copies of a file on the same volume without occupying additional storage space. When you start modifying one of the copies, the new data is then written elsewhere. They, however, continue to share unmodified data blocks. This reduces space required for revisions to copies of the same document.

Another important bit is APFS support for snapshots, which is basically a copy of the file system at a certain point in time.

Then, there are the other stuffs, important no doubt, but perhaps many users probably don’t care too much. For example, APFS supports sparse files and proper native support for extended attributes.

But according to Apple’s developer documentation, interestingly, AFP is deprecated and cannot be used to share APFS volumes.

Leave a Reply

Your email address will not be published. Required fields are marked *

View Comment Policy