|Full name||Hierarchical File System Plus|
|Introduced||January 19, 1998 (Mac OS 8.1)|
|Partition identifier||Apple_HFS (Apple Partition Map)
Apple_HFSX (Apple Partition Map) when HFSX
|Max file size||8 EiB|
|Max number of files||4,294,967,295 (232-1)|
|Max filename length||255 characters (255 UTF-16 encoding units, normalized to Apple-modified variant of Unicode Normalization Format D)|
|Max volume size||8 EiB |
|Allowed characters in filenames||Unicode, any character, including NUL. OS APIs may limit some characters for legacy reasons|
|Dates recorded||access, attributes modified, backed up, contents modified, created|
|Date range||January 1, 1904 - February 6, 2040|
|Attributes||Color (3 bits, all other flags 1 bit), locked, custom icon, bundle, invisible, alias, system, stationery, inited, no INIT resources, shared, desktop|
|File system permissions||Unix permissions, ACLs (Mac OS X v10.4 onward)|
|Transparent compression||Yes (on OS X 10.6 and higher)|
|Transparent encryption||No, although per-home directory AES using HFS+ formatted .dmg volumes is possible using FileVault in Mac OS X v10.3 onward|
|Supported operating systems||Mac OS 8.1, Mac OS 9, Mac OS X, & Darwin, Linux, Microsoft Windows (through MacDrive or Bootcamp IFS drivers)|
HFS Plus or HFS+ is a file system developed by Apple Inc. to replace their Hierarchical File System (HFS) as the primary file system used in Macintosh computers (or other systems running Mac OS). It is also one of the formats used by the iPod digital music player. HFS Plus is also referred to as Mac OS Extended (or, erroneously, “HFS Extended”), where its predecessor, HFS, is also referred to as Mac OS Standard (or, erroneously, as “HFS Standard”). During development, Apple referred to this filesystem with the codename Sequoia.
HFS Plus is an improved version of HFS, supporting much larger files (block addresses are 32-bit length instead of 16-bit) and using Unicode (instead of Mac OS Roman or any of several other character sets) for naming the items (files, folders) – names which are also character encoded in UTF-16 and normalized to a form very nearly the same as Unicode Normalization Form D (NFD) (which means that precomposed characters like é are decomposed in the HFS+ filename and therefore count as two characters and UTF-16 implies that characters from outside the Basic Multilingual Plane — often seldom used and characters from ancient writing systems — also count as two characters in an HFS+ filename). HFS Plus permits filenames up to 255 UTF-16 characters in length, and n-forked files similar to NTFS, though until recently, almost no software takes advantage of forks other than the data fork and resource fork. HFS Plus also uses a full 32-bit allocation mapping table, rather than HFS’s 16 bits. This was a serious limitation of HFS, meaning that no disk could support more than 65,536 allocation blocks under HFS. When disks were small, this was of little consequence, but as larger-capacity drives became available, it meant that the smallest amount of space that any file could occupy (a single allocation block) became excessively large, wasting significant amounts of space. For example, on a 1 GB disk, the allocation block size under HFS is 16 KB, so even a 1 byte file would take up 16 KB of disk space.
With the release of the 10.2.2 update on November 11, 2002, Apple added optional journaling features to HFS Plus for improved data reliability. These features were easily accessible in Mac OS X Server, but only accessible through the command line in the standard desktop client. With Mac OS X v10.3, all HFS Plus volumes on all Macs are set to be journaled by default. Within the system, an HFS Plus volume with a journal is identified as HFSJ.
10.3 also introduced another version of HFS Plus called HFSX. HFSX volumes are almost identical to HFS Plus volumes, except that they are never surrounded by the HFS Wrapper that is typical of HFS Plus volumes and they optionally support case sensitivity for file and folder names. HFSX volumes can be recognized by two entries in the Volume Header, a value of HX in the signature field and 5 in the version field.
With 10.4, Apple added support for Inline Attribute Data records, something that had been a part of the Mac OS X implementation of HFS Plus since at least 10.0, but always marked as "reserved for future use". Until the release of Mac OS X Server 10.4, HFS Plus supported only the standard UNIX file system permissions, however 10.4 introduced support for access control list-based file security, which provides a richer mechanism to define file permissions and is also designed to be fully compatible with the file permission models on other platforms such as Microsoft Windows XP and Windows Server 2003.
HFS Plus volumes are divided into sectors (called logical blocks in HFS), that are usually 512 bytes in size. These sectors are then grouped together into allocation blocks which can contain one or more sectors; the number of allocation blocks depends on the total size of the volume. HFS Plus uses a larger value to address allocation blocks than HFS, 32 bits rather than 16 bits; this means it can access 4,294,967,296 (= 232) allocation blocks rather than the 65,536 (= 216) allocation blocks available to HFS.
Formerly, HFS Plus volumes were embedded inside an HFS standard filesystem. This was phased out by the Tiger transition to Intel Macs, where the HFS Plus filesystem was not embedded inside a wrapper. The wrapper was designed for two purposes; it allowed Macintosh computers without HFS Plus support in their ROM to boot HFS Plus volumes and it also was designed to help users transition to HFS Plus by including a minimal HFS volume with a read-only file called Where_have_all_my_files_gone?, explaining to users with versions of Mac OS 8.0 and earlier without HFS Plus, that the volume requires a system with HFS Plus support. The original HFS volume contains a signature and an offset to the embedded HFS Plus volume within its volume header. All allocation blocks in the HFS volume which contain the embedded volume are mapped out of the HFS allocation file as bad blocks.
There are nine structures that make up a typical HFS Plus volume:
There has been some success in porting HFS+ to Linux, at least in non-journaled read/write. If the filesystem is journaled, it will default to mount in read-only mode, but it can be forced to ignore the journal temporarily (by using the 'force' option).
On Windows, a fairly complete filesystem driver for HFS+ exists as a commercial software package called MacDrive. This package allows Windows users to read and write HFS+ formatted drives, and read Mac format optical disks. Apple has released read-only HFS+ drivers for Windows XP, Windows Vista and Windows 7 in Boot Camp in Mac OS X 10.6.
A free (GPL) alternative to MacDrive is HFSExplorer written by Erik Larsson. HFSExplorer is an application for viewing and extracting files from an HFS+ volume (Mac OS Extended) or an HFSX volume (Mac OS Extended, Case-sensitive) located either on a physical disk, on a .dmg disk image, or in a raw file system dump.