Reminiscing on HFS+ / by Matt Washchuk

when HFS+ was the cool, new kid on the Mac file system block.

My first Mac was a 512ke. That’s being a bit unfair: it was my dad’s Mac, and he let me use it. I was eight years old, and his 512ke was at least two years old (he had a previous 512k stolen and saved up again to purchase the enhanced version). At the time, we had two 400k floppy drives: one built into the 512ke and one connected externally. No hard drive. Apple did make a 20 megabyte hard drive at that time, but it cost a cool $1500. The interface was the Apple DB-19 connector, a zombie port not used again, once the Mac Plus could connect external SCSI hard drives. When the Apple HD 20 surfaced in 1985, Apple needed a file system for the drive, so they came up with HFS (Hierarchal File System). From what I’ve read, much of it was based on the Apple III file system.

The smallest file size on a disk formatted with HFS is 1/65,535 of the size of the hard drive. When a hard drive is only 20 MB, that math gives us a number less than the theoretical minimum of 512 bytes. That means you need two empty files to take up 1 kilobyte of space on your drive. Not too big a deal.

But what happens when you suddenly have a 2 GB hard drive? Now the smallest file size is 32 KB, even if you have a single byte of data in the file. It doesn’t take a mathematician to figure out that’s an unsustainable allocation size. So, Apple engineers needed a better file system. In January 1998 (almost 15 years after the introduction of HFS), Apple introduced HFS+ in the Mac OS 8.1 system update. The conventional name for HFS+ is Mac OS Extended, and HFS was renamed Mac OS Standard. Besides improving the minimum file allocation size, there are numerous changes and improvements in HFS+. There are numerous problems in HFS+, too. I won’t get into that discussion, but if you’re interested in more details, you should basically just read anything John Siracusa has written on the subject.

When Apple debuted HFS+ in the Mac OS 8.1 update, there were two caveats worth mentioning. First, Apple had transitioned from the 680x0 family of processors to the PowerPC processors in the mid 1990s. Mac OS 8 and 8.1 needed at least a 68040 processor (officially) to run, and 8.1 was the final version of Mac OS that ran on the 680x0 family of processors. 68040 Macs could use HFS+ formatted partitions, but they couldn’t boot from them. To this day, I have never been able to learn what the technical limitation was that prevented my Centris 610 from booting an HFS+ formatted volume. I can’t believe it’s the logic board’s ROM code, since all PowerPC Macs could boot from HFS+ volumes, but they debuted years before Apple wrote the code for the HFS+ system. The only thought I’ve had is that 68040 Macs couldn’t use virtual memory swap files from HFS+ volumes, and by Mac OS 8.1, swap files were an integral (if not required) part of the operating system. If anyone actually knows why 68K Macs couldn’t boot HFS+ volumes, though, I’d love to know.

The second caveat was Apple needed a graceful way of handling what a System 7 user (or Mac OS 8.0 user) saw when he or she hooked up an HFS+ formatted external hard drive to his/her System 7 machine. Since System 7 knew nothing of HFS+, the system would have asked the user to format the hard drive every time it was connected to the computer, and that would have been a terrible idea. So, Apple devised an HFS “wrapper” that would go around the HFS+ volume that the old System 7 computers could read. The wrapper volume would contain a single file entitled, “Where_have_all_my_files_gone?” You couldn’t see any of the files on the HFS+ volume, but you could open this single file on the HFS wrapper volume, and it would explain that you needed a computer running at least Mac OS 8.1 to be able to view the hard drive.

Years later, when Mac OS X debuted, HFS+ hung tough. Back in the days of 10.0, 10.1, and 10.2, Apple shipped Macs with both Mac OS 9 and OS X preinstalled, and HFS+ needed to be the format of choice. When Apple’s Disk Utility initialized partitions, it still included the “Where_have_all_my_files_gone?” HFS wrapper. That changed when Apple released Mac OS X 10.5, and no Mac shipping that required 10.5 or later had the wrapper.

I wondered, however, if it was possible that a Mac running Yosemite today could still have the wrapper on its disk, and it appears that the answer is theoretically yes: thanks to Mactracker, I found that the Mid 2007 iMac first shipped with Mac OS X 10.4.10, so if you got one of those Macs in August or September 2007 before Apple released Leopard in October 2007 (and bundled it on all new Macs), you got a machine with the HFS wrapper. Well, it appears that the Mid 2007 iMac is the only Mac that originally shipped with Mac OS X 10.4 that can still run the latest version of Mac OS X. That means if you upgraded the iMac to 10.5, then to 10.6 (and 10.6.8), you could install 10.10 on the system and still have the HFS wrapper on your hard drive.

Despite all that has been written about HFS+ over the years, I think it’s pretty cool (scary?) that a Mac in 2015 could be using a file system introduced in 1998, wrapped in a file system introduced in 1985.