HFS+ volume header

Prev | Home | Next

Description

Each HFS Plus volume contains a volume header 1024 bytes from the start of the volume. The volume header contains information about the volume as a whole, including the location of other key structures in the volume. A copy of the volume header, the alternate volume header, is stored starting 1024 bytes before the end of the volume. The alternate volume header is intended for use solely by disk repair utilities.

Hexdump [BIN] [TXT]

00000000  48 2b 00 04 00 00 21 00  48 46 53 4a 00 00 00 02  |H+....!.HFSJ....|
00000010 
c3 75 dd 2d c3 75 b3 70  00 00 00 00 c3 75 b2 fd  |.u.-.u.p.....u..|
00000020 
00 00 00 0b 00 00 00 04  00 00 10 00 00 00 28 f6  |..............(.|
00000030 
00 00 1f fd 00 00 0c 21  00 01 00 00 00 01 00 00  |.......!........|
00000040 
00 00 00 21 00 00 00 6e  00 00 00 00 00 00 00 01  |...!...n........|
00000050 
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000060 
00 00 00 00 00 00 00 00  54 c0 89 b3 26 cc a5 b9  |........T...&...|
00000070  00 00 00 00 00 00 10 00  00 00 10 00 00 00 00 01  |................|
00000080  00 00 00 01 00 00 00 01  00 00 00 00 00 00 00 00  |................|
00000090  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000c0  00 00 00 00 00 05 10 00  00 05 10 00 00 00 00 51  |...............Q|
000000d0  00 00 08 03 00 00 00 51  00 00 00 00 00 00 00 00  |.......Q........|
000000e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000100  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000110  00 00 00 00 00 05 10 00  00 05 10 00 00 00 00 51  |...............Q|
00000120  00 00 08 54 00 00 00 51  00 00 00 00 00 00 00 00  |...T...Q........|
00000130  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000140  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000150  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000160  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000170  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000180  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000190  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000200

C struct [TXT]

struct HFSPlusVolumeHeader {
    UInt16              signature;
    UInt16              version;
    UInt32              attributes;
    UInt32              lastMountedVersion;
    UInt32              journalInfoBlock;
 
    UInt32              createDate;
    UInt32              modifyDate;
    UInt32              backupDate;
    UInt32              checkedDate;
 
    UInt32              fileCount;
    UInt32              folderCount;
 
    UInt32              blockSize;
    UInt32              totalBlocks;
    UInt32              freeBlocks;
 
    UInt32              nextAllocation;
    UInt32              rsrcClumpSize;
    UInt32              dataClumpSize;
    HFSCatalogNodeID    nextCatalogID;
 
    UInt32              writeCount;
    UInt64              encodingsBitmap;
 
    UInt32              finderInfo[8];
 
    HFSPlusForkData     allocationFile;
    HFSPlusForkData     extentsFile;
    HFSPlusForkData     catalogFile;
    HFSPlusForkData     attributesFile;
    HFSPlusForkData     startupFile;
};
typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader;

Offsets in the HFS+ volume header

+0x000

signature

 

0x482b

[H+]

+0x002

version

 

0x0004

[4]

+0x004

attributes

 

0x00002100

[0000 0000 0000 0000 0010 0001 0000 0000b]

+0x008

lastMountedVersion

 

0x446534a

[HFSJ]

+0x00C

journalInfoBlock

 

0x00000002

[2]

+0x010

createDate

 

0xc375dd2d

[]

+0x014

modifyDate

 

0xc375b370

[]

+0x018

backupDate

 

0x00000000

[]

+0x01C

checkedDate

 

0xc375b2fd

[]

+0x020

fileCount

 

0x0000000b

[11]

+0x024

folderCount

 

0x00000004

[4]

+0x028

blockSize

 

0x00001000

[4096]

+0x02C

totalBlocks

 

0x000028f6

[10486]

+0x030

freeBlocks

 

0x00001ffd

[8189]

+0x034

nextAllocation

 

0x00000c21

[3105]

+0x038

rsrcClumpSize

 

0x00010000

[65536]

+0x03C

dataClumpSize

 

0x00010000

[65536]

+0x040

nextCatalogID

 

0x0000021

[33]

+0x044

writeCount

 

0x0000006e

[110]

+0x048

encodingsBitmap

 

0x0000000000000001

[]

+0x050

finderInfo

finderInfo[0]

0x00000000

[0]

+0x054

 

finderInfo[1]

0x00000000

[0]

+0x058

 

finderInfo[2]

0x00000000

[0]

+0x05C

 

finderInfo[3]

0x00000000

[0]

+0x060

 

finderInfo[4]

0x00000000

[0]

+0x064

 

finderInfo[5]

0x00000000

[0]

+0x068

 

finderInfo[6]

0x54c089b3

[0x54c089b3]

+0x06C

 

finderInfo[7]

0x26cca5b9

[0x26cca5b9]

+0x070

allocationFile

logicalSize

0x0000000000001000

[4096]

+0x078

 

clumpSize

0x00001000

[4096]

+0x07C

 

totalBlocks

0x00000001

[1]

+0x080

 

extent[0].startBlock

0x00000001

[1]

+0x084

 

extent[0].blockCount

0x00000001

[1]

+0x088

 

extent[1].startBlock

0x00000000

[0]

+0x08C

 

extent[1].blockCount

0x00000000

[0]

+0x090

 

extent[2].startBlock

0x00000000

[0]

+0x094

 

extent[2].blockCount

0x00000000

[0]

+0x098

 

extent[3].startBlock

0x00000000

[0]

+0x09C

 

extent[3].blockCount

0x00000000

[0]

+0x0A0

 

extent[4].startBlock

0x00000000

[0]

+0x0A4

 

extent[4].blockCount

0x00000000

[0]

+0x0A8

 

extent[5].startBlock

0x00000000

[0]

+0x0AC

 

extent[5].blockCount

0x00000000

[0]

+0x0B0

 

extent[6].startBlock

0x00000000

[0]

+0x0B4

 

extent[6].blockCount

0x00000000

[0]

+0x0B8

 

extent[7].startBlock

0x00000000

[0]

+0x0BC

 

extent[7].blockCount

0x00000000

[0]

+0x0C0

extentsFile

logicalSize

0x0000000000051000

[331776]

+0x0C8

 

clumpSize

0x00051000

[331776]

+0x0CC

 

totalBlocks

0x00000051

[81]

+0x0D0

 

extent[0].startBlock

0x00000803

[2051]

+0x0D4

 

extent[0].blockCount

0x00000051

[81]

+0x0D8

 

extent[1].startBlock

0x00000000

[0]

+0x0DC

 

extent[1].blockCount

0x00000000

[0]

+0x0E0

 

extent[2].startBlock

0x00000000

[0]

+0x0E4

 

extent[2].blockCount

0x00000000

[0]

+0x0E8

 

extent[3].startBlock

0x00000000

[0]

+0x0EC

 

extent[3].blockCount

0x00000000

[0]

+0x0F0

 

extent[4].startBlock

0x00000000

[0]

+0x0F4

 

extent[4].blockCount

0x00000000

[0]

+0x0F8

 

extent[5].startBlock

0x00000000

[0]

+0x0FC

 

extent[5].blockCount

0x00000000

[0]

+0x100

 

extent[6].startBlock

0x00000000

[0]

+0x104

 

extent[6].blockCount

0x00000000

[0]

+0x108

 

extent[7].startBlock

0x00000000

[0]

+0x10C

 

extent[7].blockCount

0x00000000

[0]

+0x110

catalogFile

logicalSize

0x0000000000051000

[331776]

+0x118

 

clumpSize

0x00051000

[331776]

+0x11C

 

totalBlocks

0x00000051

[81]

+0x120

 

extent[0].startBlock

0x00000854

[2132]

+0x124

 

extent[0].blockCount

0x00000051

[81]

+0x128

 

extent[1].startBlock

0x00000000

[0]

+0x12C

 

extent[1].blockCount

0x00000000

[0]

+0x130

 

extent[2].startBlock

0x00000000

[0]

+0x134

 

extent[2].blockCount

0x00000000

[0]

+0x138

 

extent[3].startBlock

0x00000000

[0]

+0x13C

 

extent[3].blockCount

0x00000000

[0]

+0x140

 

extent[4].startBlock

0x00000000

[0]

+0x144

 

extent[4].blockCount

0x00000000

[0]

+0x148

 

extent[5].startBlock

0x00000000

[0]

+0x14C

 

extent[5].blockCount

0x00000000

[0]

+0x150

 

extent[6].startBlock

0x00000000

[0]

+0x154

 

extent[6].blockCount

0x00000000

[0]

+0x158

 

extent[7].startBlock

0x00000000

[0]

+0x15C

 

extent[7].blockCount

0x00000000

[0]

+0x160

attributesFile

logicalSize

0x0000000000000000

[0]

+0x168

 

clumpSize

0x00000000

[0]

+0x16C

 

totalBlocks

0x00000000

[0]

+0x170

 

extent[0].startBlock

0x00000000

[0]

+0x174

 

extent[0].blockCount

0x00000000

[0]

+0x178

 

extent[1].startBlock

0x00000000

[0]

+0x17C

 

extent[1].blockCount

0x00000000

[0]

+0x180

 

extent[2].startBlock

0x00000000

[0]

+0x184

 

extent[2].blockCount

0x00000000

[0]

+0x188

 

extent[3].startBlock

0x00000000

[0]

+0x18C

 

extent[3].blockCount

0x00000000

[0]

+0x190

 

extent[4].startBlock

0x00000000

[0]

+0x194

 

extent[4].blockCount

0x00000000

[0]

+0x198

 

extent[5].startBlock

0x00000000

[0]

+0x19C

 

extent[5].blockCount

0x00000000

[0]

+0x1A0

 

extent[6].startBlock

0x00000000

[0]

+0x1A4

 

extent[6].blockCount

0x00000000

[0]

+0x1A8

 

extent[7].startBlock

0x00000000

[0]

+0x1AC

 

extent[7].blockCount

0x00000000

[0]

+0x1B0

startupFile

logicalSize

0x0000000000000000

[0]

+0x1B8

 

clumpSize

0x00000000

[0]

+0x1BC

 

totalBlocks

0x00000000

[0]

+0x1C0

 

extent[0].startBlock

0x00000000

[0]

+0x1C4

 

extent[0].blockCount

0x00000000

[0]

+0x1C8

 

extent[1].startBlock

0x00000000

[0]

+0x1CC

 

extent[1].blockCount

0x00000000

[0]

+0x1D0

 

extent[2].startBlock

0x00000000

[0]

+0x1D4

 

extent[2].blockCount

0x00000000

[0]

+0x1D8

 

extent[3].startBlock

0x00000000

[0]

+0x1DC

 

extent[3].blockCount

0x00000000

[0]

+0x1E0

 

extent[4].startBlock

0x00000000

[0]

+0x1E4

 

extent[4].blockCount

0x00000000

[0]

+0x1E8

 

extent[5].startBlock

0x00000000

[0]

+0x1EC

 

extent[5].blockCount

0x00000000

[0]

+0x1F0

 

extent[6].startBlock

0x00000000

[0]

+0x1F4

 

extent[6].blockCount

0x00000000

[0]

+0x1F8

 

extent[7].startBlock

0x00000000

[0]

+0x1FC

 

extent[7].blockCount

0x00000000

[0]

Fields of the HFS+ volume header

signature

description: The volume signature.

possible values:

'BD'

HFS volume

'H+'

HFS+ volume

'HX'

HFSX volume

version

description: The version of the volume format.

possible values:

4

HFS+ volume

5

HFSX volume

attributes

description: The attributes field of a volume header is treated as a set of one-bit flags.

possible values:

Bit

Attribute name

Description

0 - 7

Reserved

 

8

kHFSVolumeUnmountedBit

This bit is set if the volume was correctly flushed before being unmounted or ejected.

9

kHFSVolumeSparedBlocksBit

This bit is set if there are any records in the extents overflow file for bad blocks (belonging to file ID kHFSBadBlockFileID).

10

kHFSVolumeNoCacheRequiredBit

This bit is set if the blocks from this volume should not be cached.

11

kHFSBootVolumeInconsistentBit

This bit is similar to kHFSVolumeUnmountedBit, but inverted in meaning.

12

kHFSCatalogNodeIDsReusedBit

This bit is set when the nextCatalogID field overflows 32 bits, forcing smaller catalog node IDs to be reused. When this bit is set, it is common (and not an error) for catalog records to exist with IDs greater than or equal to nextCatalogID.

13

kHFSVolumeJournaledBit

If this bit is set, the volume has a journal.

14

Reserved

 

15

kHFSVolumeSoftwareLockBit

This bit is set if the volume is write-protected due to a software setting. Any implementations must refuse to write to a volume with this bit set.

16 - 31

Reserved

 

lastMountedVersion

description: A value which uniquely identifies the implementation that last mounted this volume for writing. Any code which modifies the on disk structures must also set this field to a unique value which identifies that code. Third-party implementations of HFS Plus should place a registered creator code in this field.

possible values:

'8.10'

Mac OS 8.1 to 9.2.2

'10.0'

Mac OS X

'HFSJ'

Journaled volume (including HFSX) in Mac OS X

journalInfoBlock

description: The allocation block number of the allocation block which contains the JournalInfoBlock for this volume's journal. This field is valid only if bit kHFSVolumeJournaledBit is set in the attribute field; otherwise, this field is reserved.

createDate

description: The date and time when the volume was created.

modifyDate

description: The date and time when the volume was last modified.

backupDate

description: The date and time when the volume was last backed up.

checkedDate

description: The date and time when the volume was last checked for consistency.

fileCount

description: The total number of files on the volume. The fileCount field does not include the special files. It should equal the number of file records found in the catalog file.

folderCount

description: The total number of folders on the volume. The folderCount field does not include the root folder. It should equal the number of folder records in the catalog file, minus one (since the root folder has a folder record in the catalog file).

blockSize

description: The allocation block size, in bytes.

totalBlocks

description: The total number of allocation blocks on the disk.

freeBlocks

description: The total number of unused allocation blocks on the disk.

nextAllocation

description: Start of next allocation search. The nextAllocation field is used by Mac OS as a hint for where to start searching for free allocation blocks when allocating space for a file. It contains the allocation block number where the search should begin.

rsrcClumpSize

description: The default clump size for resource forks, in bytes.

dataClumpSize

description: The default clump size for data forks, in bytes.

nextCatalogID

description: The next unused catalog ID.

writeCount

description: This field is incremented every time a volume is mounted.

encodingsBitmap

description: This field keeps track of the text encodings used in the file and folder names on the volume.

finderInfo

description: This array of 32-bit items contains information used by the Mac OS Finder, and the system software boot process.

Item

Description

finderInfo[0]

To contain the directory ID of the directory containing the bootable system. It is zero if there is no bootable system on the volume.

finderInfo[1]

To contain the parent directory ID of the startup application (for example, Finder), or zero if the volume is not bootable.

finderInfo[2]

To contain the directory ID of a directory whose window should be displayed in the Finder when the volume is mounted, or zero if no directory window should be opened.

finderInfo[3]

To contain the directory ID of a bootable Mac OS 8 or 9 System Folder, or zero if there isn't one.

finderInfo[4]

Reserved.

finderInfo[5]

To contain the directory ID of a bootable Mac OS X system, or zero if there is no bootable Mac OS X system on the volume.

finderInfo[6]

To contain a first half of a 64-bit unique volume identifier.

finderInfo[7]

To contain a second half of a 64-bit unique volume identifier.

allocationFile

description: Information about the location and size of the allocation file.

Item

Description

logicalSize

The size, in bytes, of the allocation file.

clumpSize

The fork's clump size for the allocation file.

totalBlocks

The total number of allocation blocks used by the allocation file.

extent[0].startBlock

The first allocation block for the extent[0] of the allocation file.

extent[0].blockCount

The length, in allocation blocks, of the extent[0] of the allocation file.

extent[1].startBlock

The first allocation block for the extent[1] of the allocation file.

extent[1].blockCount

The length, in allocation blocks, of the extent[1] of the allocation file.

extent[2].startBlock

The first allocation block for the extent[2] of the allocation file.

extent[2].blockCount

The length, in allocation blocks, of the extent[2] of the allocation file.

extent[3].startBlock

The first allocation block for the extent[3] of the allocation file.

extent[3].blockCount

The length, in allocation blocks, of the extent[3] of the allocation file.

extent[4].startBlock

The first allocation block for the extent[4] of the allocation file.

extent[4].blockCount

The length, in allocation blocks, of the extent[4] of the allocation file.

extent[5].startBlock

The first allocation block for the extent[5] of the allocation file.

extent[5].blockCount

The length, in allocation blocks, of the extent[5] of the allocation file.

extent[6].startBlock

The first allocation block for the extent[6] of the allocation file.

extent[6].blockCount

The length, in allocation blocks, of the extent[6] of the allocation file.

extent[7].startBlock

The first allocation block for the extent[7] of the allocation file.

extent[7].blockCount

The length, in allocation blocks, of the extent[7] of the allocation file.

Prev | Home | Next

©2004 - 2008 [Vyacheslav Dubeyko | Äóáåéêî Âÿ÷åñëàâ] slava@dubeyko.com