Washington Apple Pi Journal, March/April 1998, pp. 36-39, reprint information
Apple released an update to Mac OS 8 in January, creating a blizzard of commentary and speculation in magazines, news groups, bulletin boards and Web sites. Mac OS 8.1 (the official name for Mac OS 8 once the update is applied) offers many fixes and improvements to the operating system, but the most revolutionary change is HFS Plus.
HFS: The Old Way
Since roughly 1986 or so, the Macintosh has stored data on disks (hard disks, floppy disks) using a scheme called HFS, or Hierarchical Filing System. Under HFS, the space on a volume is divided into equal-sized segments called "allocation blocks," and the smallest size of an allocation block is 512 bytes. Additionally, any volume must have fewer than 65,535 allocation blocks. In 1986, when a floppy diskette held 800,000 bytes and a hard disk was possibly 5 megabytes, 65,535 blocks seemed almost limitless. But some quick math reveals that 65,000 times 512 bytes is 33 million bytes -- a tiny amount of space by the standards of 1998.
If an HFS volume can have no more than 65,000 blocks, what happens when you start using larger and larger drives? The answer is: the allocation block size increases. To ridiculous extremes:
Size of drive
Allocation block size
On a four billion byte drive (about average in 1998), saving a document consisting of a single character, say the letter "a," will consume just one byte. But the hard drive must allocate a block capable of holding 65,536 bytes to hold that one byte -- a huge waste. Many Macintosh files actually come in two parts, a "data fork" and a "resource fork." Without going into detail as to what these terms mean, in practice it is possible to store a single file (from the user's point of view) that is, say, 200 bytes in size, but with a data fork and a resource fork. Since the forks must be stored separately, this means that this 200 byte file could actually end up using 131,072 bytes of disk space. If the user also wanted to give the file a spiffy custom color icon, this must be stored separately, too, meaning there would be three blocks consumed, for a total of 196,608 bytes of disk space -- all to store this 200 byte file.
HFS Plus: The New Way
All of this was somewhat academic until the price of hard drive space started to plummet, and even "low end" computers started shipping with hard drives in the 2, 3, 4, and 5 gigabyte range. Owners of new Macs were alarmed to see very small files taking up colossal amounts of disk space. Various Internet hoaxes about disk-space consuming viruses that infected your computer after reading "infected" E-mail messages started to seem plausible. The real culprit -- the 1986-vintage Hierarchical Filing System -- seemed so esoteric that it was actually less credible, in the eyes of novice users.
So Apple, after years of research work and testing, released HFS Plus with Mac OS 8.1. There are a number of new features in HFS+ (some of which won't be fully supported until future Mac OS updates), but the most obvious one is a more efficient use of storage space. Instead of a maximum of 65,000 blocks, HFS+ allows for slightly less than 4.3 billion blocks. Instead of the allocation block size increasing as the capacity of a volume increases, HFS+ permits some control over block size. The default is a 4K (4096) byte block size for volumes over one billion bytes. If you take this to extremes, it means that one volume could hold up to 4 billion blocks of data of 4096 bytes, which is 17,592 megabytes. Or a whole lot of data. Or possibly the size of next year's version of Microsoft Office.
Rather than talk about HFS+ in terms of dry numbers, especially really big dry numbers, take a "real world" example. A brand-new Quantum three gigabyte (three billion byte) drive was formatted, first with HFS, then with HFS+. In both cases, a single software package, Claris Home Page 3.0, was then installed on the drive. Claris Home Page 3.0 is an excellent, extremely popular package for designing Web pages, with one somewhat frightening characteristic: it installs, literally, thousands of files on your hard drive. But it seems far less frightening on an HFS+ drive, as the screen shots show: it takes up only 18% as much drive space.
A three billion byte hard drive, formatted with Mac OS 8, shows that Claris Home Page 3.0 requires 277.3 million bytes of space to hold just 37.2 million bytes of data.
The same three billion byte drive, formatted with Mac OS 8.1 as an HFS Plus volume, shows that Claris Home Page 3.0 requires 50.3 million bytes of space to hold 37.2 million bytes of data -- a huge improvement.
HFS Plus: How To
When the Mac OS 8.1 Update was first posted on Apple's Web site (creating a huge international Internet traffic jam as the entire planet tried to download the 16 megabyte file), little mention was made of how to create HFS+ volumes. Apple and various other vendors did make it clear, however, that no existing disk formatting or recovery utilities supported HFS+, beyond Apple's own Disk First Aid 8.1 and Drive Setup 1.4 (both included with Mac OS 8.1). So Mac OS 8.1 users were given a new technology, but no means to use it, right?
Not quite. If you have more than one volume (either two hard drives or one large hard drive divided up into multiple partitions), you can easily format an existing volume with HFS+ using the Finder:
Selecting Erase Disk under the Finder's Special menu in Mac OS 8.1 offers you a new formatting option: Mac OS Extended. Select this option if you want to try out the new features of HFS+.
Part 2 of 2 parts