I expect to wait a long time before updating to macOS 10.15 (Catalina) but I am doing some preparation for my iMac environment. Today I want to report on Time Machine. (I am running macOS 10.14.6 Mavericks)
This week I looked at the file format for the various hard drives in my system. My 2017 iMac is formatted in APFS (must have come that way when I bought it). All my other external hard drives (2 Super Duper clones and 2 Time Machine drives) are in HFS Extended
I understand that Super Duper is not Catalina compliant at this point so I didnāt touch those drives
One of the TM drives is small (500 GB) so I decided to change the file format to APFS using Disk Utility
That worked as expected. NOTE THE PROCESS ERASED THE PRIOR HISTORY.
I had an APFS external hard drive that I āattachedā to the Time Machine routine in System Preferences.
To my GREAT surprise I next received a system message that the drive format was incompatible AND it proceeded to change the format to HFS Extended.
I have looked at the drive and it is back to HFS
So the Time Machine process (in Mavericks at least) does not work with APFS drives.
Just so you know, 10.14 is Mojave. Mavericks was 10.9.
On my main Mojave Mac the internal SSD is APFS and all external HDDs I use for TimeMachine are HFS Extended (nowadays apparently āMac OS Extendedā).
I might be misremembering, but I believe the default for an external HDD on Mojave is still to format as Mac OS Extended. My recollection is that APFS is really geared primarily towards SSDs and that there is no huge benefit to using it on HDDs. I also seem to remember that you can only use APFS on HDDs if they are GPT (MBR is a no go).
With external drives, you can do whatever you want (but thereās no win to APFS on hard drives).
With internal hard drives, High Sierra would not reformat them to APFS (only SSDs), but Mojave reformats all internal drives to APFS, regardless of type (SSD, Fusion Drive, hard drive).
Based on some articles Iāve read in the last few days, I believe that the reason a drive used to store TM backups has to be HFS+ is that TM uses āhard linksā as part of its storage architecture, and that APFS doesnāt support hard links.
Hereās another Time Machine / drive formatting mystery that I encountered recently.
I have a 2009-vintage iMac; itās past its prime but still working well. Or was, until the original rotating HD drive failed last week. So I replaced the drive with a 500GB SSD. More accurately, I paid a Mac repair shop to do the job, since Iām not up for disassembling iMacs. Fortunately, I had a full Time Machine backup (stored on a Time Capsule), and for good measure, an off-site backup at Backblaze.
When I got the machine back from the shop, I noticed that the new SSD was formatted for HFS+. Iāve read many articles indicating that APFS is preferred for SSDs, so I set out to convert the new SSD. The shop had installed High Sierra on it. I booted the iMac into the Recovery partition, and then used Disk Utility to erase and format the SSD as APFS. Then, still in the Recovery partition, I used the Recover from Time Machine Backup utility to restore the drive. (Before the restore transfer started, a pop-up appeared warning that the SSD would be erased and that all data on it would be lostā¦). Six long hours later, the restore from the Time Capsule completed, and the iMac booted from the SSD.
To my surprise, the SSD was back to HFS+. I surmise that when the Restore utility erased the SSD at the start of the transfer, it must have decided to erase/format it as HFS+, even though the drive is an internal SSD. That doesnāt seem to be consistent with Appleās stated policy to format SSDs as APFS (unless they are external drives being used to store TM backups).
Good news in all this: the old iMac is noticeably faster with the SSD upgrade.
So how does macos make it look like hard links work on an APFS volume? The ln command seems to work as expected, and a directory and . in that directory are hard linked, as are .. and the containing directoryās parent (except in / of course). Is there a layer above the actual file system that somehow emulates hard links?
My impression, from the time of the debut of Time Machine, is that hard links to files have always been widely supported but that there are complexities to making hard links to foldersāthereās no standard implementation, and there are potential problems with infinite recursion if a folder contains a hard link to itself.
The implementation of TM required hard links to folders, so Apple made it work in their own way, but itās not a feature that was deemed necessary for APFS.
At the filesystem level, hard links (to both files and directories) have been supported for a long time, maybe back to the first Unix filesystem, because in fact everythingās a hard link. But yes, lots and lots of code has been written that assumes the only things that turn a directory tree into what it really is, a directory graph, are . and .., so any other hard links to directories will break that code. Thatās why making hard links to directories has always required root privilege, although itās been possible in every Unix-derivative Iāve used (maybe excepting macos on an APFS file system, where I havenāt tried).
However, either APFS also supports hard links to directories, or thereās a layer or something that emulates them, because . and .. still work as expected, including reporting the same inode number as the directory theyāre linked to.
Good question, but one that I canāt answer. The way in which Time Machine weaves its tapestry of hourly/daily/weekly/monthly backups (without consuming vast amounts of disk space) is beyond my pay grade.
I asked the same question on stackexchange, and someone answered that . and .. are special cases: . is always the directory itās in, and thereās a parent_id field in the inode with the inode number of the parent. There arenāt separate directory entries for either like on older file systems. I havenāt verified that but it sounds reasonable. That does mean there must be a layer that translates that into what a vast number of standard tools expect to see.