Time Machine drive format experiment

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.

Is this true in Catalina also?

Jerry

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).

Yes. See (which is updated for Catalina):

Right. Got the number right but not the ā€œnameā€

My iMac only has a rotating internal HD and Iā€™ve been told that is possible part of why it is sluggish.

Some place I thought I had read that Catalina only works with APFS drives but that must be for clones that you want to boot from

Thanks

As TidBITS contributor Glenn Fleishman wrote a few days ago in https://www.macworld.com/article/3441857/why-you-re-prompted-to-erase-an-external-drive-when-you-use-it-with-time-capsule.html, Time Machine drives must be formatted as HFS+, not APFS, even in Catalina.

1 Like

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).

Thanks, Adam. Good to know. :slight_smile:

Thanks I wish I had done the research before erasing the small TM drive Now into an 8 hour rebuild

Jerry

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.

1 Like

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.