Stored data, whether it’s on a physical disk connected to your Mac or accessed remotely over a network or the cloud, is usually managed in chunks. On physical disks, these are normally known as blocks. A file system is responsible for turning those blocks into individual files, and organising those into directories and other structural systems such as volumes.
Inevitably, there are many different ways of doing this, but it’s common ground that the file system has metadata which not only tells it which blocks make up each file, and the arrangement and hierarchy of directories, but provide information about each file, such as its name, the date and time it was created, who has permission to read and write to it, and so on. This metadata – the file system metadata – is itself kept in the storage.
To enable software to access the files in that storage, each type of file system supports standard features such as calls to create a new file, read and write to it, and more. Different file systems also support additional features: HFS+, the older of the two Mac file systems in common use, allows ‘hard links’ to be made to its directories, which is very unusual, but doesn’t support ‘sparse files’ which are supported by APFS, its newer replacement.
macOS currently has built-in support for around 15 different file systems, which notably include:
- APFS, Apple’s modern file system of choice.
- HFS+, Apple’s previous file system of choice.
- exFAT, Microsoft’s file system introduced in 2006, and commonly used on Flash storage.
- NFS, a distributed file system developed by Sun in 1984, still used on some networked storage.
- NTFS, Microsoft’s main file system from Windows NT 3.1.
- AFP, Apple’s older network file system protocol, now being phased out.
- SMB, a cross-platform network file system protocol, which has largely replaced AFP.
You can see the main list of supported file systems in /System/Library/Filesystems, and some are also supported by kernel extensions and other components. You can also add third-party support for other file systems including ZFS.
In a perfect world, these would all be transparent to the user. All you would have to do is connect to that storage system, and the Finder and your software would be able to see and work with that storage like any other. However, because of the differences between their features, there are plenty of traps into which you can fall.
Some are simple but surprising. You’re unlikely to know when a file stored on APFS is kept in very compact sparse format. But copy that 5 MB to an HFS+ volume and it could suddenly expand to full size, taking several GB, and may take minutes to copy to far more space than you had anticipated. Two of the more common frustrations which Mac users can experience when working across different file systems are naming problems resulting from case-sensitivity and Unicode normalisation, and differences in handling extended attributes.
Older file systems like MS-DOS may not handle case at all, and can have severe constraints on the naming of files and directories. More modern file systems may be quite the opposite, and allow the two files This.text and this.text in the same directory. When these come into collision, problems are likely, for example preventing you from copying a folder containing those two files to an APFS volume on your Mac, as by default macOS APFS preserves case but isn’t case-sensitive, unlike the flavour of APFS used by iOS.
Unicode normalisation is another trap which catches even the most wary. Because some Unicode characters which are visibly identical can have two or more different encodings, some file systems normalise these into one standard form, either Form C or Form D. Given a choice of two, both are in use, and other file systems don’t normalise at all. For a great many writing systems, this makes little difference, but when using accented Roman characters or Korean it can cause havoc.
Extended attributes are additional file metadata which are stored in the file system metadata of HFS+ and APFS. Although they’re not peculiar to Apple’s operating systems, they are used more extensively in macOS than elsewhere. They can contain important supplementary information about a file, such as whether it’s in quarantine, where it was downloaded from, or copyright details. There are schemes to retain at least some metadata on exFAT and related file systems, but generally extended attributes get stripped when files are moved to non-Mac file systems.
Finally, cloud file systems are different again, as they’re normally built on huge distributed databases, which work quite differently. You’re no doubt already familiar with iCloud’s illusion that it’s just an extension of your Mac’s file system, and may have come across the Amazon Elastic File System used on AWS Cloud services. In most cases you’ll never deal with the underlying cloud file system, just its front end when working with Dropbox, iCloud and others.