Linux MD is the kernel’s software RAID (levels 0, 1, 4, 5, 6 and 10), managed by mdadm and identified by a superblock on each member. It is common in Linux servers and many NAS devices, including Synology, and it is actively maintained.
Overview
MD members carry a superblock identifying the array UUID, RAID level, chunk size, layout, member number and event counter. Version 0.90 stores it near the end of the device, 1.0 at the end, 1.1 at the start and 1.2 4 KiB from the start. Supported levels include linear, RAID0, RAID1, RAID4, RAID5, RAID6 and RAID10. When metadata is damaged the implementation can solve disk order and layout heuristically.
History
Developed by Ingo Molnar and later Neil Brown for Linux 2.x; superblock version 1 introduced around 2006.
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.
Read Version090
Offset
Size
Type
Field
Notes
0x0
4
u32 LE
–
0x4
4
u32 LE
–
0x8
4
u32 LE
–
at
4
u32 LE
0
10 * 4
4
u32 LE
Raid Disks
11 * 4
4
u32 LE
Name
32 * 4
4
u32 LE
Updated
38 * 4
4
u32 LE
–
39 * 4
4
u32 LE
Events
40 * 4
4
u32 LE
Events
6 * 4
4
u32 LE
Created
64 * 4
4
u32 LE
Layout
65 * 4
4
u32 LE
Chunk Bytes
7 * 4
4
u32 LE
Level
8 * 4
4
u32 LE
Used Sectors
KB
w * 4
4
u32 LE
W
thisDisk + 12
4
u32 LE
Raid Disk
thisDisk + 16
4
u32 LE
State
Read Version1
Offset
Size
Type
Field
Notes
0x0
4
u32 LE
–
0x4
4
u32 LE
–
0x8
4
u32 LE
Features
0x40
8
u64 LE
Created
0x48
4
u32 LE
Level
0x4C
4
u32 LE
Layout
0x50
8
u64 LE
Used Sectors
0x58
4
u32 LE
Chunk Bytes
0x5C
4
u32 LE
Raid Disks
0x80
8
u64 LE
Data Offset
0x88
8
u64 LE
Data Size
0x90
8
u64 LE
Super Offset
0xA0
4
u32 LE
Dev Number
0xC0
8
u64 LE
Updated
0xC8
8
u64 LE
Events
0xD8
4
u32 LE
–
0xDC
4
u32 LE
Ax Dev
at
4
u32 LE
0
at
2
u16 LE
–
256 + (int)devNumber * 2
2
u16 LE
Value
Time40
Offset
Size
Type
Field
Notes
at
2
u16 LE
–
at
4
u32 LE
–
at
8
u64 LE
–
Constants
Md Raid Module
Name
Value
Type
Notes
MagicV1
[0xFC, 0x4E, 0x2B, 0xA9, 0x01, 0x00, 0x00, 0x00]
byte[]
Md Superblock
Name
Value
Type
Notes
Magic
0xA92B4EFC
uint
BlockSize
4096
int
Sector
512
int
Raid Order Solver
Name
Value
Type
Notes
Mounted
4
int
Implementation limits
Class
Name
Value
Notes
Raid Order Solver
MaxUnknown
7
Structures and constants were extracted from the implementation. Prose sections are a summary from public sources; verify details before relying on them.