Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
HFS Plus
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== 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 (= 2<sup>32</sup>) allocation blocks rather than the 65,536 (= 2<sup>16</sup>) allocation blocks available to HFS.<ref name="tn1150" /> 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]]<ref>{{Cite web|url=https://www.applexsoft.com/glossary/hfs-plus.html|title=What is Mac OS HFS+ format?|website=AppleXsoft|access-date=2018-11-06|archive-url=https://web.archive.org/web/20180824144248/http://www.applexsoft.com/glossary/hfs-plus.html|archive-date=2018-08-24|url-status=live}}</ref> and normalized to a form very nearly the same as [[Unicode equivalence|Unicode Normalization Form D (NFD)]]<ref>{{cite web | url=https://developer.apple.com/qa/qa2001/qa1235.html | title=Technical Q&A QA1235: Converting to Precomposed Unicode | date=February 7, 2003 | work=Apple Developer Connection | access-date=2007-03-28 | url-status=live | archive-url=https://web.archive.org/web/20080518105836/http://developer.apple.com/qa/qa2001/qa1235.html | archive-date=May 18, 2008 }}</ref> (which means that precomposed characters like "Γ₯" are decomposed in the HFS+ filename and therefore count as two code units<ref>There are some minor differences derived from the fact that the HFS Plus format was finalized before Unicode had standardized the NFD format (see [https://developer.apple.com/legacy/library/technotes/tn/tn1150.html#UnicodeSubtleties "Unicode Subtleties"] {{Webarchive|url=https://web.archive.org/web/20130622040013/https://developer.apple.com/legacy/library/technotes/tn/tn1150.html#UnicodeSubtleties |date=2013-06-22 }} for more information)</ref> and UTF-16 implies that characters from outside the [[Plane (Unicode)#Basic Multilingual Plane|Basic Multilingual Plane]] 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''.<ref name="tn1150" /> Notable among file systems used for Unix systems, HFS Plus does not support [[sparse file]]s. There are nine structures that make up a typical HFS Plus volume:<ref name="tn1150" /> # Sectors 0 and 1 of the volume are HFS '''[[Boot sector|boot blocks]]'''. These are identical to the boot blocks in an HFS volume. They are part of the HFS wrapper.<ref>{{cite web|url=https://developer.apple.com/library/archive/documentation/mac/Files/Files-101.html#HEADING101-0|title=Boot Blocks|work=Inside Macintosh|date=July 2, 1996|publisher=Apple Inc.}}</ref> # 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]] that contains records for all the files and directories stored in the volume. The HFS Plus Catalog File is very similar to the [[Hierarchical File System (Apple)#Design|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]]. 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.<ref name="tn1150" />
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)