Hierarchical File System Plus (HFS+)


Jarret W. Buse

Hierarchical File System Plus (HFS+)

The Hierarchical File System Plus (HFS+) was introduced in January 19, 1998 by Apple Computers as an enhancement of their HFS file system.

The maximum volume size supported by HFS+ is 8 Exabytes with a maximum file size of 8 Exabytes. The maximum file name length is 255 characters using UTF-16 characters.

The directories and their contents are managed by a B-Tree file. The file allocation is stored in a bitmap file, while bad blocks are tracked by a B-Tree file.

Stored dates can be in the range of January 1, 1904 to February 6, 2040 just like with HFS.

HFS+ was introduced to replace the standard Hierarchical File System (HFS). HFS uses 16-bit integers for addressing limiting the maximum number of files. HFS+ uses a 32-bit integer for addressing, making the maximum number of files 4,294,967,295 on a volume.

With Mac OS X 10.2.2, Apple updated HFS+ to include Journaling. Journaling was optional to use. With OS X 10.3, Journaling was enabled by default on HFS+ volumes. HFS+ with journaling is sometimes referred to as HFSJ. Journaling is a method to allow data/metadata to be recovered in case of an improper shutdown.

Another option which came with OS X 10.3 was HFSX. This system allowed for optional case sensitivity with directory and file names. Also, the HFSX is identical to HFS+, but it does not need the HFS Wrapper. The wrapper is when the ROM contains support to allow an HFS+ volume to boot. HFSX did not need the ROM support to boot.

Mac OS X 10.4 included HFS+ support to include Access Control List (ACL) permissions. ACLs allow permissions of not only who can access a file, but what they can do to the files such as read, write, modify, delete, etc.

In Mac OS X 10.5, hard linking was added. Hard linking is the ability of a directory and file structure to use pointers. The pointers are associated with a file name for example, and points to the address of the physical file. When a copy is made of the file and the file is renamed, then two files point to the same address. For example, we create File1 in DirectoryA and then copy it to DirectoryB. File1 in DirectoryB is renamed to File2. In the B-Tree containing the file allocations, the physical address for File1 and File2 are the same. Two files on the HFS+ volume really only occupy the space of one file. Until one file is modified, this remains true. When one file is modified, it is written to another spot on the disk and the pointer is changed for the modified file.

With the release of Mac OS X 10.6, HFS+ was updated by adding support for compression. The addition of compression added the ability for more drive space by compressing files.

For security, Mac OS X 10.7 added the ability of encryption. Files can now be secured from being accessed even when a hard disk is removed and attempted to be accessed in another system.

Each HFS+ volume is made up of nine sections as follows:

1. Boot Blocks - Blocks 0 and 1 contain the Boot Blocks to load the Operating System
2. Volume Header - Block 2 holds the Volume Header. The Volume Header is similar to the Master Directory Block (MDB) of HFS. The volume Header contains volume information as well as the location of the Catalog File and Extent Overflow File.
3. Catalog File – a B-Tree file that contains folder and file records. Each record can be between 4 KB and 8 KB (HFS records were 512 bytes). Records up to eight file extents per file.
4. Allocation File – This file stores the information about used blocks. The file is a flat file but is similar to a bitmap file. Free blocks are represented with a ‘0’ bit and used blocks contain a ‘1’. The file does not have to be contiguous on the disk.
5. Extents Overflow File – B-Tree records of the addresses of each file after the first eight located in the Catalog File. Blocks are marked as bad in this file. The record size in the Extents Overflow is between 1 KB and 4 KB.
6. Attribute File – B-Tree file which contains 4 KB records of three different types:
a. Fork Data Attribute – references eight extents of larger attributes
b. Extension Attribute – extends Fork Data Attribute record past eight extents
c. Inline Data Attribute – records attributes of files
7. Startup File – used for systems which are not Macs that do not have built in support for HFS or HFS+
8. Alternate Volume Header – the second to last block on the volume contains a backup copy of the Volume Header
9. Last block – a reserved block used by Apple

HFS+ included in the Linux kernel has a bug which causes problems on volumes larger than 2 TB. Also, journaling has been found to cause some issues as well. Journaling can be enabled and the volume mounted, but users should be cautious of this setup.

To save space, compression is supported in HFS+ just as on HFS.

Similar to HFS, HFS+ supports the Advanced Encryption Standard (AES) encryption.


  • slide.jpg
    57.7 KB · Views: 81,836

For those of you that are using a Debian-based Linux distro that lacks the ability to use HFS+ filesystems, use this command to install the needed utilities. This also provides the tools needed for HFS.

apt-get install hfsutils hfsprogs hfsutils-tcltk