The ext family is the standard Linux file system: ext2 (1993), ext3 (journaling, 2001) and ext4 (extents and 64-bit sizes, 2008). ext4 is the default on many distributions and is also found on Android devices, NAS boxes, Chromebooks and virtual machine disks, and the format is actively maintained.
Overview
The ext family divides the volume into block groups, each with a copy of or pointer to group descriptors, bitmaps, an inode table and data blocks. The superblock sits 1024 bytes from the start. ext2 uses indirect block maps; ext3 adds a journal; ext4 adds extents, 64-bit sizes, flex block groups, metadata checksums and other feature flags (compatible, incompatible and read-only compatible sets).
History
ext was written by Rémy Card in 1992; ext2 followed in 1993.
ext3 added journaling and was merged into Linux 2.4.15 (2001).
ext4 was marked stable in Linux 2.6.28 (2008).
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.
Has Block Map
Offset
Size
Type
Field
Notes
0x0
2
u16 LE
–
0x2
2
u16 LE
–
i * 4
4
u32 LE
–
Has Non Zero Extent
Offset
Size
Type
Field
Notes
0x2
2
u16 LE
Entries
0x6
2
u16 LE
Leaf
entry + 4
4
u32 LE
–
entry + 4
2
u16 LE
–
entry + 6
2
u16 LE
–
entry + 8
4
u32 LE
–
entry + 8
2
u16 LE
–
Inode Attribute
Offset
Size
Type
Field
Notes
0x80
2
u16 LE
Start
position
4
u32 LE
–
start
4
u32 LE
–
position + 1
1
u8
Index
position + 2
2
u16 LE
Value Offset
position + 4
4
u32 LE
Value Inode
position + 8
4
u32 LE
Value Size
Is Directory Block
Offset
Size
Type
Field
Notes
position
4
u32 LE
–
position + 4
2
u16 LE
Record Length
position + 6
2
u16 LE
Name Length
position + 6
1
u8
Name Length
Map Blocks
Offset
Size
Type
Field
Notes
44 + level * 4
4
u32 LE
–
i * 4
4
u32 LE
–
Read Metadata Block
Offset
Size
Type
Field
Notes
0x0
2
u16 LE
–
0x2
2
u16 LE
–
Recovered Inodes
Offset
Size
Type
Field
Notes
0x0
2
u16 LE
–
0x14
4
u32 LE
Now Deleted
0x14
4
u32 LE
–
0x1A
2
u16 LE
–
0x64
4
u32 LE
Same Generation
Recovered Inodes
Offset
Size
Type
Field
Notes
0x0
2
u16 LE
–
0x14
4
u32 LE
–
0x1A
2
u16 LE
–
0x64
4
u32 LE
–
Scan Deleted Inodes
Offset
Size
Type
Field
Notes
0x0
2
u16 LE
–
0x14
4
u32 LE
–
Walk Extent Node
Offset
Size
Type
Field
Notes
0x0
4
u32 LE
Logical
0x4
2
u16 LE
Length
0x4
4
u32 LE
Child
0x6
2
u16 LE
Physical
0x8
4
u32 LE
Physical
0x8
2
u16 LE
Child
Walk Extent Node
Offset
Size
Type
Field
Notes
0x0
2
u16 LE
–
0x2
2
u16 LE
Entries
0x6
2
u16 LE
Depth
Parse Dirents
Offset
Size
Type
Field
Notes
position
4
u32 LE
Inode
position + 4
2
u16 LE
Record Length
position + 6
2
u16 LE
Name Length
position + 6
1
u8
Name Length
position + 7
1
u8
File Type
Scan Slack
Offset
Size
Type
Field
Notes
position
4
u32 LE
Inode
position + 4
2
u16 LE
Record Length
position + 6
2
u16 LE
Name Length
position + 6
1
u8
Name Length
position + 7
1
u8
File Type
Index
Offset
Size
Type
Field
Notes
0x0
4
u32 BE
–
0x4
4
u32 BE
–
0x8
4
u32 BE
Sequence
Index
Offset
Size
Type
Field
Notes
0x0
4
u32 BE
Target
0x4
4
u32 BE
Flags
0x6
2
u16 BE
Flags
0x8
4
u32 BE
–
Load
Offset
Size
Type
Field
Notes
0x0
4
u32 BE
–
0x4
4
u32 BE
Type
0xC
4
u32 BE
Journal Block Size
0x10
4
u32 BE
Ax Length
0x14
4
u32 BE
First
0x28
4
u32 BE
–
Parse
Offset
Size
Type
Field
Notes
0x0
2
u16 LE
Ode
0x2
2
u16 LE
Uid
0x4
4
u32 LE
Size
0x14
4
u32 LE
Deletion Time
0x18
2
u16 LE
Gid
0x1A
2
u16 LE
Links
0x1C
4
u32 LE
Blocks
0x20
4
u32 LE
Flags
0x28
60
bytes
Block Field
0x64
4
u32 LE
Generation
0x68
4
u32 LE
File Acl
0x6C
4
u32 LE
Size High
0x74
2
u16 LE
Blocks
0x76
2
u16 LE
File Acl
0x78
2
u16 LE
Uid
0x7A
2
u16 LE
Gid
0x80
2
u16 LE
Extra Size
Time
Offset
Size
Type
Field
Notes
extraOffset
4
u32 LE
Extra
offset
4
u32 LE
Seconds
Try Parse
Offset
Size
Type
Field
Notes
0x0
4
u32 LE
–
0x0
4
u32 LE
Inodes Count
0x4
4
u32 LE
Blocks
0xC
4
u32 LE
Free Blocks
0x10
4
u32 LE
Free Inodes
0x14
4
u32 LE
First Data Block
0x18
4
u32 LE
Log Block Size
0x20
4
u32 LE
Blocks Per Group
0x28
4
u32 LE
Inodes Per Group
0x2C
4
u32 LE
Last Mount Time
0x30
4
u32 LE
Last Write Time
0x38
2
u16 LE
–
0x3A
2
u16 LE
State
0x4C
4
u32 LE
Revision
0x54
4
u32 LE
–
0x58
2
u16 LE
–
0x5A
2
u16 LE
–
0x5C
4
u32 LE
–
0x60
4
u32 LE
–
0x64
4
u32 LE
–
0xE0
4
u32 LE
–
0xFE
2
u16 LE
Descriptor Size
0x104
4
u32 LE
First Meta Group
0x150
4
u32 LE
Blocks
0x158
4
u32 LE
Free Blocks
Parse
Offset
Size
Type
Field
Notes
0x0
4
u32 LE
–
0x8
4
u32 LE
–
0x12
2
u16 LE
–
0x1C
2
u16 LE
–
0x20
4
u32 LE
–
0x28
4
u32 LE
–
0x32
2
u16 LE
–
Other fields read
Read in
Offset
Size
Type
Field
Notes
Read Symlink
0x0
2
u16 LE
Extent Header
Walk Indirect
i * 4
4
u32 LE
Entry
Index
0x0
4
u32 BE
–
Has Root Directory
0x0
2
u16 LE
–
Constants
Ext File System
Name
Value
Type
Notes
ExtentMagic
0xF30A
ushort
RootInode
2
uint
StrictUtf8
new(false, true)
UTF8Encoding
Ext Journal
Name
Value
Type
Notes
Magic
0xC03B3998
uint
TypeDescriptor
1
uint
TypeSuperblockV1
3
uint
TypeSuperblockV2
4
uint
Incompat64Bit
0x2
uint
IncompatCsumV2
0x8
uint
IncompatCsumV3
0x10
uint
TagEscape
0x1
uint
TagSameUuid
0x2
uint
TagLast
0x8
uint
s_feature_compat
Name
Value
Type
Notes
CompatHasJournal
0x4
uint
s_feature_incompat
Name
Value
Type
Notes
IncompatFileType
0x2
uint
IncompatRecover
0x4
uint
IncompatMetaBg
0x10
uint
IncompatExtents
0x40
uint
Incompat64Bit
0x80
uint
IncompatFlexBg
0x200
uint
IncompatLargeDir
0x4000
uint
IncompatInlineData
0x8000
uint
IncompatEncrypt
0x10000
uint
s_feature_ro_compat
Name
Value
Type
Notes
RoCompatSparseSuper
0x1
uint
RoCompatLargeFile
0x2
uint
RoCompatGdtCsum
0x10
uint
RoCompatHugeFile
0x8
uint
RoCompatExtraIsize
0x40
uint
RoCompatBigAlloc
0x200
uint
RoCompatMetadataCsum
0x400
uint
Ext Superblock
Name
Value
Type
Notes
Magic
0xEF53
ushort
Struct
Name
Value
Type
Notes
BlockUninit
0x2
ushort
InodeUninit
0x1
ushort
Ext Inode
Name
Value
Type
Notes
FlagImmutable
0x10
uint
FlagAppend
0x20
uint
FlagEncrypted
0x800
uint
FlagIndex
0x1000
uint
FlagHugeFile
0x40000
uint
FlagExtents
0x80000
uint
FlagInlineData
0x10000000
uint
Ext Module
Name
Value
Type
Notes
SuperblockOffset
1024
int
SuperblockSize
1024
int
Implementation limits
Class
Name
Value
Notes
Ext File System
MaxExtentDepth
5
Ext File System
MaxMappings
4_000_000
Ext File System
MaxDirectoryBytes
256L * 1024 * 1024
Ext File System
MaxSymlinkLength
4096
Ext File System
MaxLostEntries
200_000
Ext File System
MaxOverwriteChecks
256
Ext Allocation Map
MaxCachedGroups
256
Ext Journal
MaxCopiesPerBlock
64
Entry Kind
Name
Value
Live
(next)
Deleted
(next)
Recovered
(next)
Structures and constants were extracted from the implementation. Prose sections are a summary from public sources; verify details before relying on them.