Experience changes everything

Data recovery company you are glad you know

HFS Plus File system

Mac OS X operating system supports many file system. HFS+ is preferred on Mac OS X system. Similar to primary version HFS, HFS Plus volume format was designed to improve some important characteristics such as:

- Efficient use of disk space.
- International-friendly file names.
- Future support for named forks.
- Ease booting on non-Mac OS operating systems.

HFS Plus specifies how a volume (user files with the structure to retrieve the data) exists on a disk. The storage space on a disk is divided into allocation blocks. HFS Plus uses 32-bit values (instead of 16-bit for HFS) to identify allocation blocks. This allows up to 2 32 allocation blocks on a volume. More allocation blocks means a smaller allocation block size, less wasted space, and more available space distributed among a larger number of files.

The typical node size for an HFS Plus catalog B-tree is 4 KB. B-tree index node must store at least two keys and may occupy a variable amount of space determined by the actual size of the key.

HFS Plus uses up to 255 Unicode characters to store file names making easier to have very descriptive names. Long names are especially useful when the name is computer-generated.

Files on an HFS volume have two forks: a data fork and a resource fork, either of which may be empty (zero length). Files and directories also contain a small amount of additional information (known as catalog information or metadata) such as the modification date or Finder info. HFS Plus has an attribute file, another B-tree, which can be used to store additional information for a file or directory. Since it is part of the volume format, this information can be kept with the file or directory as is it moved or renamed, and can be deleted when the file or directory is deleted.

HFS Plus uses the structures to manage the organization of data on the volume. These structures include:

- Volume header.
- Catalog file.
- Extents overflow file.
- Attributes file.
- Allocation file (bitmap).
- Startup file.

General structure of an HFS+ volume.

Sector Function
0,1 Boot blocks
2 (reserved 1024 bytes) Volume Header stores data about the volume itself (size of allocation blocks, time of volume creation, location of Catalog File. The Volume Header has fixed location.
File data or free space
Allocation File keeps track of free allocation blocks and blocks in use. Each allocation block is represented by one bit. A 0 means the block is free and a 1 means the block is in use. Allocation File is stored as a regular file and can also change size.
File data or free space
Catalog File (B-tree) contains records for all the files and directories stored in the volume. The records are larger to allow more fields and to allow for those fields to be larger (the longer 255-character unicode file names). A record in the HFS Plus Catalog File is 8KB in Mac OS X. Fields in size can vary depending on the actual size of the data they store.
File data or free space
Extents Overflow File (B-tree) records the allocation blocks that represent each file extents. Each file record in the Catalog File is able to record eight extents for each fork of a file. The default size of an extent record 4 KB in Mac OS X.
File data or free space
Attributes File stores three different types of 4 KB records: Inline Data Attribute records (keep small attributes within the record itself), Fork Data Attribute records (store references to up to eight extents that can hold larger attributes) and Extension Attribute records (extends a Fork Data Attribute record when its eight extent records are already used).
File data or free space
Startup File is developped for non-Mac OS systems with no HFS Plus support.
1024 bytes from the end of the volume Alternate Volume Header.
Last (512 bytes) Reserved for Apple use.

HFS Plus has a number of changes vs. HFS. The following table summarizes the important differences.

Feature HFS HFS Plus
Operating System Mac OS Mac OS X
Number of allocation blocks 16 bits 32 bits
Length of file names Up to 32 characters Up to 255 characters
File name encoding MacRoman Unicode
File/folder attributes Support for fixed size attributes Allows for future meta-data extensions
Catalog node size 512 bytes 4 KB
Maximum file size 2^31 bytes 2^63 bytes

More About