HPFS is the OS/2 file system from IBM and Microsoft (1989), also usable by Windows NT 3.x until NT 4.0 dropped it. It is obsolete today and turns up on old OS/2, eComStation and ArcaOS disks and in dual-boot images.
Overview
HPFS organizes the disk in 512-byte sectors grouped into bands with free-space bitmaps. A superblock at sector 16 and a spare block at sector 17 point to the root fnode. Directories are B-trees of entries held in 2 KiB dirblocks, and file data is mapped by fnodes with run lists. Names may be up to 254 characters, are case-preserving and can carry extended attributes.
History
Co-developed by IBM and Microsoft for OS/2 1.2 (1989).
Windows NT 3.1 and 3.5 could use it; support was dropped from NT 4.0 in favor of NTFS.
Structures
Offsets are in bytes from the start of the structure named in each heading. Field names are descriptive and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.
Load Code Pages
Offset
Size
Type
Field
Notes
0x0
4
u32 LE
–
0x4
4
u32 LE
Count
0xC
4
u32 LE
Sector
at + 2
2
u16 LE
Code Page
at + 0x0C
2
u16 LE
Index
Load Hotfixes
Offset
Size
Type
Field
Notes
(int)(i + total) * 4
4
u32 LE
Replacement
(int)i * 4
4
u32 LE
Bad
Read Allocation
Offset
Size
Type
Field
Notes
at
4
u32 LE
–
at + 4
4
u32 LE
Sectors
header + 8 + i * 8 + 4
4
u32 LE
Alsec
header + 5
1
u8
Used
at + 8
4
u32 LE
–
Walk
Offset
Size
Type
Field
Notes
0x0
4
u32 LE
–
0x4
4
u32 LE
First Free
Parse Freed Fnode
Offset
Size
Type
Field
Notes
FnodeContainingDir
4
u32 LE
Parent
FnodeEaInternalSize
2
u16 LE
Ea Size
FnodeEaRunSize
4
u32 LE
Ea Size
FnodeFileSize
4
u32 LE
Size
Mount
Offset
Size
Type
Field
Notes
0x27
4
u32 LE
Number
0x36
4
bytes
–
Hpfs Const
Offset
Size
Type
Field
Notes
o
4
u32 LE
–
o
2
u16 LE
–
Parse
Offset
Size
Type
Field
Notes
0x0
4
u32 LE
–
0x4
4
u32 LE
–
0x8
1
u8
Flags
0xC
4
u32 LE
Hotfix List
0x10
4
u32 LE
Hotfixes Used
0x14
4
u32 LE
Hotfixes Max
0x20
4
u32 LE
Code Page Info
Parse
Offset
Size
Type
Field
Notes
0x0
4
u32 LE
–
0x4
4
u32 LE
–
0x8
1
u8
Version
0x9
1
u8
Functional Version
0xC
4
u32 LE
Root Fnode
0x10
4
u32 LE
Total Sectors
0x14
4
u32 LE
Bad Sectors
0x18
4
u32 LE
Bitmap List
0x28
4
u32 LE
Last Chkdsk
0x34
4
u32 LE
Dir Band Start
0x38
4
u32 LE
Dir Band End
Parse
Offset
Size
Type
Field
Notes
offset
2
u16 LE
Length
offset + 2
1
u8
Flags
offset + 3
1
u8
–
offset + 4
4
u32 LE
–
offset + length – 4
4
u32 LE
–
offset + 8
4
u32 LE
–
offset + 0x0C
4
u32 LE
–
offset + 0x10
4
u32 LE
–
offset + 0x14
4
u32 LE
–
offset + 0x18
4
u32 LE
–
offset + 0x1D
1
u8
–
offset + 0x1E
1
u8
Name Length
Other fields read
Read in
Offset
Size
Type
Field
Notes
Folder Dir Block
FnodeAllocation + 8 + 8
4
u32 LE
–
first ALLEAF’s disk sector
From Dirent
FnodeFileSize
4
u32 LE
Size
Load Bitmap
band * 4
4
u32 LE
Sector
Read Allocation
0x0
4
u32 LE
–
Read Sectors
0x0
4
u32 LE
–
Constants
Hpfs Const
Name
Value
Type
Notes
SectorSize
512
int
DirBlockSectors
4
int
DirBlockSize
DirBlockSectors * SectorSize
int
SectorsPerBand
16384
int
SuperblockLsn
16
uint
SpareblockLsn
17
uint
SuperMagic1
0xF995E849
uint
SuperMagic2
0xFA53E9C5
uint
SpareMagic1
0xF9911849
uint
SpareMagic2
0xFA5229C5
uint
FnodeMagic
0xF7E40AAE
uint
AlsecMagic
0x37E40AAE
uint
DirBlockMagic
0x77E40AAE
uint
CodePageInfoMagic
0x494521F7
uint
FNODE
Name
Value
Type
Notes
FnodeNameLength
0x0C
int
FnodeName
0x0D
int
FnodeContainingDir
0x1C
int
FnodeEaRunSize
0x2C
int
FnodeEaInternalSize
0x34
int
FnodeFlags
0x37
int
FnodeAllocation
0x38
int
FnodeFileSize
0xA0
int
FnodeIsDirectory
0x01
byte
Allocation block header flags
Name
Value
Type
Notes
AllocNodes
0x80
byte
DIRENT
Name
Value
Type
Notes
DirentSpecial
0x01
byte
DirentDown
0x04
byte
DirentEnd
0x08
byte
DirentNameOffset
0x1F
int
AttrReadOnly
0x01
byte
AttrHidden
0x02
byte
AttrSystem
0x04
byte
AttrDirectory
0x10
byte
AttrArchive
0x20
byte
Implementation limits
Class
Name
Value
Notes
Hpfs File System
MaxTreeDepth
32
Hpfs File System
MaxLostEntries
100_000
Hpfs File System
ScanChunkSectors
2048
Hpfs File System
MaxRecoverabilitySectors
16 * 1024 * 1024
Signatures and magic strings referenced
Text
Where checked
HPFS
Mount
Structures and constants were extracted from the implementation. Prose sections are a summary from public sources; verify details before relying on them.