Which file systems and Cloud services preserve extended attributes?

One argument often made against using extended attributes in macOS is that they are not supported on other operating systems or file systems. This article considers what support there is, both in local/networked file systems, and in Cloud and similar services.

You can always, of course, archive and compress files with extended attributes using the bundled Archive Utility and Zip format, which does preserve all extended attributes. This quickly becomes tedious, and is only suitable for special occasions. If you’re going to trust a file system or Cloud service with your xattrs, you must be able to do so when copying/moving files directly.

File systems

File systems which provide full and native support for extended attributes:

Mac Extended (HFS+) and Apple File System (APFS). It is sometimes claimed that HFS+ only supports xattrs with data up to 128 KB in size; that is not correct, as xattr.h sets XATTR_MAXSIZE to 64 MiB, which seems to be the absolute limit.

Linux ext3 and ext4 provide excellent support too, but in some distributions xattrs are disabled, and have to be enabled through the /etc/fstab settings. Check with your distribution’s documentation before trying to use them. Other Linux file systems and ZFS should also provide full support.

NTFS includes full support in what it terms alternate data streams (ADS)

File systems on which macOS arranges full support for extended attributes:

Most others, including FAT variants such as FAT32 and ExFAT, as commonly used on USB memory sticks.

In FAT32 and ExFAT, macOS creates an AppleDouble file containing xattr content, which is named by prefixing the main file name with ._ (period/stop, underscore), a hidden file. Those appear to be subject to a lower maximum file size in xattr.h of 128 KiB, which may be the origin of the claim that that is the maximum size supported by HFS+.

File systems which do not support extended attributes:

NFS as a general rule. However, support is now available in some NFSv4 implementations. This has changed again with High Sierra: its NFSv4 client requires that you enable an option called ‘Enforce extended attributes and named forks if supported by server’ in the NFS client (see man 5 nfs, or NFS Manager documentation). You may need to update to macOS 10.13.2 for this to work properly.

Cloud and similar services

Services which provide full support for extended attributes, including custom types:

None known, although in some circumstances iCloud Drive can.

Services which provide support for some extended attributes:

Dropbox preserves (?all) com.apple xattrs, but probably no others, although this document claims that it supports all xattrs.

iCloud Drive should, according to Apple, support all xattrs. In practice, particularly when moving files between Sierra and High Sierra (in either direction), it only seems to support some com.apple xattrs, and strips all third-party ones. Further details are here.

Resilio Sync limits xattr support according to a whitelist at .sync\StreamsList, and by size. Details are here.

Services which do not support extended attributes:

Box, Google Drive, Microsoft OneDrive, OmniPresence, SugarSync, Sync.

I am very grateful to Michael Tsai, who has summarised available information for his EagleFiler product. If you want to check for yourself, this support page of his details each Cloud service in turn, with links to their product support pages.