JFS (IBM Journaled File System)

JFS is IBM’s journaling file system from AIX and OS/2, open-sourced and merged into Linux 2.5. It sees only maintenance in Linux and is rarely chosen for new systems, but it survives on AIX servers and older Linux installs.

Overview

JFS organizes the volume into aggregates containing file sets. Inodes are allocated dynamically, files are mapped with extents, and directories use B+ trees. Only metadata is journaled. The superblock is at byte offset 32768 and begins with the signature JFS1.

History

  • Original JFS shipped with AIX 3.1 (1990); the revised JFS2 followed for OS/2 and AIX 5L.
  • IBM released the code under GPL and it was merged into Linux 2.5 in 2002.

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.

Jfs File System

OffsetSizeTypeFieldNotes
0x88u64 LEAggregate Blocks
0x104u32 LEBlock Size
0x184u32 LEAggregate Blocks

Make Entry

OffsetSizeTypeFieldNotes
0x188u64 LESize
0x2C4u32 LE–
0x304u32 LE–
0x344u32 LEOde

Pxd

OffsetSizeTypeFieldNotes
(at + 4)4u32 LE–
at4u32 LELength Address

Read Dtree

OffsetSizeTypeFieldNotes
e4u32 LEChild
at + 161u8Flag
at + 171u8Count
at + 211u8Table Slot

Read Superblock

OffsetSizeTypeFieldNotes
0x04bytes–
0x104u32 LEBlock Size
0x184u32 LEPhysical

Time

OffsetSizeTypeFieldNotes
at4u32 LESeconds
at + 44u32 LENull

Volume Details

OffsetSizeTypeFieldNotes
0x44u32 LE–
0x244u32 LE–
0x284u32 LEState

Xtree Extents

OffsetSizeTypeFieldNotes
e + 31u8Offset
e + 44u32 LEOffset
at + 161u8Flag
at + 182u16 LENext

Probe

OffsetSizeTypeFieldNotes
0x88u64 LEVolume Length
0x104u32 LEBlock Size
0x184u32 LEVolume Length

Other fields read

Read inOffsetSizeTypeFieldNotes
Is Allocated3072 + (bit >> 5) * 44u32 LEWordpersistent map, high bit first
Jfs File System0x188u64 LEAp Size
Label0x8816bytesVolume Serial
Read Aggregate Inode0x84u32 LE–
Read Inode0x84u32 LE–

Constants

Jfs File System

NameValueTypeNotes
Super10x8000, Super2 = 0xF000, AggregateInodeTable = 0xB000long
InodeSize512, Page = 4096int

Signatures and magic strings referenced

TextWhere checked
JFS1Read Superblock
Structures and constants were extracted from the implementation. Prose sections are a summary from public sources; verify details before relying on them.