HOME

TheInfoList



OR:

HFS Plus or HFS+ (also known as Mac OS Extended or HFS Extended) is a
journaling file system A journaling file system is a file system that keeps track of changes not yet committed to the file system's main part by recording the goal of such changes in a data structure known as a " journal", which is usually a circular log. In the ev ...
developed by
Apple Inc. Apple Inc. is an American multinational corporation and technology company headquartered in Cupertino, California, in Silicon Valley. It is best known for its consumer electronics, software, and services. Founded in 1976 as Apple Comput ...
It replaced the
Hierarchical File System In computing, a hierarchical file system is a file system that uses directories to organize files into a tree structure. In a hierarchical file system, ''directories'' contain information about both files and other directories, called ''sub ...
(HFS) as the primary file system of Apple computers with the 1998 release of Mac OS 8.1. HFS+ continued as the primary
Mac OS X macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
file system until it was itself replaced with the
Apple File System Apple File System (APFS) is a Proprietary software, proprietary file system developed and deployed by Apple Inc. for macOS macOS Sierra, Sierra (10.12.4) and later, iOS iOS 10 , 10.3, tvOS 10.2, watchOS 3.2, and all versions of iPadOS. It aim ...
(APFS), released with macOS High Sierra in 2017. HFS+ is also one of the formats supported by the
iPod The iPod is a series of portable media players and multi-purpose mobile devices that were designed and marketed by Apple Inc. from 2001 to 2022. The iPod Classic#1st generation, first version was released on November 10, 2001, about mon ...
digital music player. Compared to its predecessor
HFS HFS may refer to: Businesses and organisations * Croatian Film Association () * Hellenic Fire Service, Greece * Hospitality Franchise Systems, US Computing * Hierarchical file system, a system for organizing directories and files * Hierarchica ...
, also called ''Mac OS Standard'' or ''HFS Standard,'' HFS Plus supports much larger files (block addresses are 32-bit length instead of 16-bit) and using
Unicode Unicode or ''The Unicode Standard'' or TUS is a character encoding standard maintained by the Unicode Consortium designed to support the use of text in all of the world's writing systems that can be digitized. Version 16.0 defines 154,998 Char ...
(instead of Mac OS Roman or any of several other character sets) for naming items. Like HFS, HFS Plus uses
B-tree In computer science, a B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree generalizes the binary search tree, allowing fo ...
s to store most volume
metadata Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive ...
, but unlike most file systems that support
hard link In computing, a hard link is a directory entry (in a Directory (computing), directory-based file system) that associates a name with a Computer file, file. Thus, each file must have at least one hard link. Creating additional hard links for a fil ...
s, HFS Plus supports hard links to directories. HFS Plus permits filenames up to 255 characters in length, and n-forked files similar to
NTFS NT File System (NTFS) (commonly called ''New Technology File System'') is a proprietary journaling file system developed by Microsoft in the 1990s. It was developed to overcome scalability, security and other limitations with File Allocation Tabl ...
, though until 2005 almost no system software took advantage of forks other than the data fork and
resource fork A resource fork is a fork of a file on Apple's classic Mac OS operating system that is used to store structured data. It is one of the two forks of a file, along with the data fork, which stores data that the operating system treats as unstruct ...
. HFS Plus also uses a full 32-bit allocation mapping table rather than HFS's 16 bits, improving the use of space on large disks.


History

Codenamed ''Sequoia'' in development, HFS+ was introduced with the January 19, 1998, release of Mac OS 8.1. With the release of the Mac OS X 10.2.2 update on November 11, 2002, Apple added optional journaling features to HFS Plus for improved data reliability. These features were accessible through the GUI, using the
Disk Utility A disk utility is a utility software, utility program that allows a user to perform various functions on a computer disk, such as disk partitioning and logical volume management, as well as multiple smaller tasks such as changing drive letters an ...
application 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 were set to be journaled by default. Within the system, an HFS Plus volume with a journal is identified as ''HFSJ''. Mac OS X 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. Mac OS X 10.3 also marked Apple's adoption of Unicode 3.2 decomposition, superseding the Unicode 2.1 decomposition used previously. This change caused problems for developers writing software for Mac OS X. Mac OS X 10.3 introduced a number of techniques that are intended to avoid fragmentating files in HFS+. With Mac OS X 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 Typically, a file system maintains permission settings for each stored item commonly files and directories that either grant or deny the ability to manipulate file system items. Often the settings allow controlling access based on function s ...
; however, 10.4 introduced support for
access control list In computer security, an access-control list (ACL) is a list of permissions associated with a system resource (object or facility). An ACL specifies which users or system processes are granted access to resources, as well as what operations are ...
–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 Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct successor to Windows 2000 for high-end and business users a ...
and
Windows Server 2003 Windows Server 2003, codenamed "Whistler Server", is the sixth major version of the Windows NT operating system produced by Microsoft and the first server version to be released under the Windows Server brand name. It is part of the Windows NT ...
. In Mac OS X Leopard 10.5, directory hard-linking was added as a fundamental part of Time Machine. In Mac OS X Snow Leopard 10.6, HFS+ compression was added using Deflate (Zlib). In open source and some other areas this is referred to as AppleFSCompression or decmpfs. Compressed data may be stored in either an extended attribute or the resource fork. When using non-Apple APIs, AppleFSCompression is not always completely transparent. OS X 10.9 introduced two new algorithms: LZVN (libFastCompression), and LZFSE. In Mac OS X Lion 10.7, logical volume encryption (known as FileVault 2) was added to the operating system. This addition to the operating system in no way changed the logical structure of the file system. Apple's logical volume manager is known as Core Storage and its encryption at the volume level can apply to file systems other than HFS Plus. With appropriate hardware, both encryption and decryption should be transparent.


Design

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. 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. HFS Plus's system greatly improves space utilization on larger disks as a result. File and folder names in HFS Plus are also encoded in
UTF-16 UTF-16 (16-bit Unicode Transformation Format) is a character encoding that supports all 1,112,064 valid code points of Unicode. The encoding is variable-length as code points are encoded with one or two ''code units''. UTF-16 arose from an earli ...
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 code units and UTF-16 implies that characters from outside the
Basic Multilingual Plane In the Unicode standard, a plane is a contiguous group of 65,536 (216) code points. There are 17 planes, identified by the numbers 0 to 16, which corresponds with the possible values 00–1016 of the first two positions in six position hexadecimal ...
also count as two code units in an HFS+ filename). HFS Plus permits filenames up to 255 UTF-16 code units in length. Formerly, HFS Plus volumes were embedded inside an HFS standard file system. This was phased out by the Tiger transition to Intel Macs, where the HFS Plus file system was not embedded inside a wrapper. The wrapper had been 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''. Notable among file systems used for Unix systems, HFS Plus does not support sparse files. There are nine structures that make up a typical HFS Plus volume: # Sectors 0 and 1 of the volume are HFS boot blocks. These are identical to the boot blocks in an HFS volume. They are part of the HFS wrapper. # Sector 2 contains the ''Volume Header'', which is equivalent to the Master Directory Block in an HFS volume. The Volume Header stores a wide variety of data about the volume itself, for example the size of allocation blocks, a timestamp that indicates when the volume was created or the location of other volume structures such as the Catalog File or Extent Overflow File. The Volume Header is always located in the same place. # The ''Allocation File'' which keeps track of which allocation blocks are free and which are in use. It is similar to the Volume Bitmap in HFS, in which each allocation block is represented by one bit. A zero means the block is free and a one means the block is in use. The main difference with the HFS Volume Bitmap, is that the Allocation File is stored as a regular file – it does not occupy a special reserved space near the beginning of the volume. The Allocation File can also change size and does not have to be stored contiguously within a volume. # The ''Catalog File'' is a
B-tree In computer science, a B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree generalizes the binary search tree, allowing fo ...
that contains records for all the files and directories stored in the volume. The HFS Plus Catalog File is very similar to the HFS Catalog File, the main differences being records are larger to allow more fields and to allow for those fields to be larger (for example to allow the longer 255-character unicode file names in HFS Plus). A record in the HFS Catalog File is 512 bytes in size; a record in the HFS Plus Catalog File is 4 KB in the classic Mac OS and 8 KB in
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
. Fields in HFS are of fixed size, while in HFS Plus the size can vary depending on the actual size of the data they store. # The ''Extents Overflow File'' is another B-tree that records the allocation blocks that are allocated to each file as extents. Each file record in the Catalog File is capable of recording eight extents for each fork of a file; once those are used additional extents are recorded in the Extents Overflow File. Bad blocks are also recorded as extents in the Extents Overflow File. The default size of an extent record in the classic Mac OS is 1 KB and 4 KB in macOS. # The ''Attributes File'' is a new B-tree in HFS Plus that does not have a corresponding structure in HFS. The Attributes File can store three different types of 4 KB records: ''Inline Data Attribute'' records, ''Fork Data Attribute'' records and ''Extension Attribute'' records. Inline Data Attribute records store small attributes that can fit within the record itself. Fork Data Attribute records contain references to a maximum of eight extents that can hold larger attributes. Extension Attributes are used to extend a Fork Data Attribute record when its eight extent records are already used. # The ''Startup File'' is designed for non-Mac OS systems that lack HFS or HFS Plus support. It is similar to the Boot Blocks of an HFS volume. # The second-to-last sector contains the ''Alternate Volume Header'', which is equivalent to the Alternate Master Directory Block of HFS. This is the second-to-last-sector for the disk, not the volume; if the disk is larger than the volume, the AVH will be outside the range of the filesystem. # The last sector in the volume is reserved for use by Apple. It is used during the computer manufacturing process.


Criticisms

HFS Plus lacks several features considered staples of modern file systems like
ZFS ZFS (previously Zettabyte File System) is a file system with Volume manager, volume management capabilities. It began as part of the Sun Microsystems Solaris (operating system), Solaris operating system in 2001. Large parts of Solaris, includin ...
and
NTFS NT File System (NTFS) (commonly called ''New Technology File System'') is a proprietary journaling file system developed by Microsoft in the 1990s. It was developed to overcome scalability, security and other limitations with File Allocation Tabl ...
. Data
checksums A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. By themselves, checksums are often used to verify data ...
are the most routinely cited missing feature. Besides checksumming, features of modern file systems that HFS+ lacks include: * nanosecond timestamps * concurrent access (that is, more than one process can access the filesystem at the same time) * snapshotting * Support for dates beyond February 6, 2040 * sparse file support * a better implementation of hard links (in other filesystems, these are typically multiple directory entries pointing to the same data blocks; hard links in macOS are implemented as small files that are stored in a special hidden directory) HFS Plus was not designed for
Unix-like A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
systems, so features such as
file system permissions Typically, a file system maintains permission settings for each stored item commonly files and directories that either grant or deny the ability to manipulate file system items. Often the settings allow controlling access based on function s ...
and
hard link In computing, a hard link is a directory entry (in a Directory (computing), directory-based file system) that associates a name with a Computer file, file. Thus, each file must have at least one hard link. Creating additional hard links for a fil ...
s had to be retrofitted when Apple moved to Mac OS X.


Other operating systems


Linux

The
Linux kernel The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
includes the hfsplus module for mounting HFS+ filesystems read-write. HFS+
fsck The system utility fsck (''file system check'') is a tool for checking the consistency of a file system in Unix and Unix-like operating systems, such as Linux Linux ( ) is a family of open source Unix-like operating systems based on the L ...
and mkfs have been ported to
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
and are part of the hfsprogs package. In 2009, these drivers were diagnosed to be corrupting HFS+ drives with a capacity greater than 2 TB. Consequently, Linux distributions such as Debian and Ubuntu stopped allowing mounting of HFS+ drives or partitions greater than 2 TB. , work is in progress to lift this restriction. Under Linux's current HFS+ driver, journaling must be disabled in order to write data safely onto an HFS+ partition. Provided the partition isn't being used by Apple's Time Machine software, journaling can be disabled under macOS: Using Disk Utility in OS X Yosemite, the user may hold Alt/Option and click "Disable Journaling" on the File menu, having first selected a mounted partition. An HFS+ partition with journaling enabled may be forcibly mounted with write access under Linux, but this is unsupported and unwise. A
Google Summer of Code The Google Summer of Code, often abbreviated to GSoC, is an international annual program in which Google awards stipends to contributors who successfully complete a free and open-source software coding project during the summer. , the program is ...
project to implement write support to journaled HFS+ was accepted by the Linux Foundation in 2011 but was not completed at that time and is still a work in progress. Progress and improvements to the HFS+ driver, including some updates to journaling support, are posted on the linux-fsdevel mailing list from time to time. , Paragon Software Group provided kernel drivers that allow full read-write access to HFS+ journaled volumes. The product is a proprietary implementation of HFS+ based on Paragon's proprietary UFSD library. There are both free and paid editions of the driver, and they include a utility for checking and repairing HFS+ volumes. According to the online documentation (free version or the paid edition), both the free edition and the paid edition currently support Linux kernels from 2.6.36 up to 4.12.x.
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
,
Debian Debian () is a free and open-source software, free and open source Linux distribution, developed by the Debian Project, which was established by Ian Murdock in August 1993. Debian is one of the oldest operating systems based on the Linux kerne ...
,
Fedora Linux Fedora Linux is a Linux distribution developed by the Fedora Project. It was originally developed in 2003 as a continuation of the Red Hat Linux project. It contains software distributed under various free and open-source licenses and aims to b ...
, Rocky Linux,
Red Hat Enterprise Linux Red Hat Enterprise Linux (RHEL) is a commercial Linux distribution developed by Red Hat. Red Hat Enterprise Linux is released in server versions for x86-64, Power ISA, ARM64, and IBM Z and a desktop version for x86-64. Fedora Linux and ...
,
OpenSUSE openSUSE () is a free and open-source software, free and open-source Linux distribution developed by the openSUSE project. It is offered in two main variations: ''Tumbleweed'', an upstream rolling release distribution, and ''Leap'', a stable r ...
and
CentOS CentOS (, from Community Enterprise Operating System; also known as CentOS Linux) is a discontinued Linux distribution that provided a free and open-source community-supported computing platform, functionally compatible with its upstream (softw ...
are the only Linux distributions officially supported.


Windows

As of May 2012, Apple has only released read-only HFS+ drivers for Windows XP, Windows Vista, and Windows 7 as part of the Boot Camp software in Mac OS X 10.6. This means users on these systems can read data on the HFS+ drive, but not write to them. Microsoft has created an HFS+ driver for the Xbox 360 mainly for the purpose of reading HFS+-formatted iPods. A free and opensource software – jHFSplus, based on HFSExplorer and jpfm – can be used to mount hfs/hfs+ partitions as read-only virtual folders. A freeware plugin for
Total Commander __NOTOC__ Total Commander is an orthodox file manager, i.e. it features two file list panels (selectable via tab key) and a Command-line interface, command line. It supports Tab (interface), multiple tabs for each panel. Total Commander is deve ...
exists, that can read, among others, HFS and HFS+ filesystems. DiskInternals Linux Reader can be used to extract/save folders/files out of HFS and HFS+ Hard Drives/Partitions. A commercial product, MacDrive, is also available for mounting HFS and HFS+ drives, optical discs, and other media in Windows Explorer, and allows both reading and writing to the volume, as well as repairing and formatting Mac disks. A commercial product, Paragon's HFS+ for Windows allows full read and write and disk management from all versions of Windows from Windows XP to Windows Server 2008.


Cross-platform

A free ( GPL) alternative is HFSExplorer written by Erik Larsson. HFSExplorer is a Java application for viewing and extracting files from an HFS+ volume (Mac OS Extended) or an HFSX volume (Mac OS Extended, Case-sensitive). The volume can be located either on a physical disk, in various
Apple disk image Apple Disk Image is a disk image format commonly used by the macOS operating system. When opened, an Apple Disk Image is mounted as a volume within the Finder. An Apple Disk Image can be structured according to one of several proprietary disk ...
and sparse disk image formats, or a raw file system dump. However, HFSExplorer is a read-only solution; it cannot write to HFS-formatted volumes.


See also

*
Comparison of file systems The following tables compare general and technical information for a number of file systems. General information Metadata All widely used file systems record a last modified time stamp (also known as "mtime"). It is not included i ...
*
Apple File System Apple File System (APFS) is a Proprietary software, proprietary file system developed and deployed by Apple Inc. for macOS macOS Sierra, Sierra (10.12.4) and later, iOS iOS 10 , 10.3, tvOS 10.2, watchOS 3.2, and all versions of iPadOS. It aim ...
– replaced HFS+ in 2017


References


External links


hfsexplorer
– Open Source Explorer for MS-Windows® written in Java, with support for HFS, HFS+, and HFSX

– HFS Plus Volume Format

– The Monster Disk Driver Technote
hfsdebug
– A debugger for HFS Plus volumes by Amit Singh
hfsprogs
– Userspace support tools for HFS+ filesystems under Linux systems (adapted from Apple's native tools).
iBored
– A disk editor and viewer supporting HFS Plus
MacDrive
– A commercial product for reading, writing and creating HFS and HFS+ volumes in Windows
HFSleuth
– A free command line tool allowing the inspection of HFS+/HFSX volumes and Disk Images (DMGs) for macOS and Linux
Mac OS X 10.7 Lion: the Ars Technica review
– A criticism about this file system {{Filesystem Disk file systems Apple Inc. file systems Macintosh operating systems MacOS Computer file systems