RAID superblock formats

From Linux Raid Wiki
Revision as of 20:01, 22 February 2008 by Grangerx (Talk | contribs)

Jump to: navigation, search

Currently, the Linux RAID subsystem recognizes two distinct variant superblocks.

They are known as v0.9 and v1.x Superblock formats.

The v1.x Superblock format is as follows:

</td> <td></td> <tr> <td>0x0c</td> <td>12</td> <td>4</td> <td>pad0</td> <td>Padding Block</td> <td>__u32</td> <td>0</td> <td>Always set to
zero when writing</td> </tr> <tr><td colspan="8"> </td></tr> <tr><td colspan="8">Section: Per-Array Identification & Configuration block</td></tr> <tr> <td>0x10</td> <td>16</td> <td>16</td> <td>set_uuid</td> <td>UUID for the Array(?)</td> <td>__u8[16]</td> <td>Set by user-space
formatting util</td> <td></td> </tr> <tr> <td>0x20</td> <td>32</td> <td>32</td> <td>set_name</td> <td>Name for the Array(?)</td> <td>char[32]</td> <td>Set and used by
user-space utils</td> <td>Nt</td> </tr> <tr> <td>0x40</td> <td>64</td> <td>8</td> <td>ctime</td> <td>Creation Time(?)</td> <td>__u64</td> <td>low 40-bits are seconds
high 24-bits are uSeconds</td> <td></td> </tr> <tr> <td>0x48</td> <td>72</td> <td>4</td> <td>level</td> <td>RAID Level
of the Array</td> <td>__u32</td> <td>
Offset (Hex) Offset (Dec) Length
(in bytes)
Field Name Usage/Meaning Data Type Data Value Notes
 
Section: Superblock Identification block
0x00 0 4 magic "Magic Number"
(Superblock ID)
__u32 0xa92b4efc
(little-endian)
0x04 4 4 major_version Major Version
of the Superblock
__u32 1
0x08 8 4 feature_map Feature Map __u32 0
Bit-Mapped Field

Bit OffsetMeaning
0RAID Bitmap is used
1(?)
2(?)
3(?)
4RAID Reshape is in progress
5(?)
6(?)
7(?)
-4Multi-Path
-1Linear
0RAID-0 (Striping)
1RAID-1 (Mirroring)
4RAID-4 (Striping with
Dedicated Parity)
5RAID-5 (Striping with
Distributed Parity)

</td> <td>RAID-6 not mentioned
in the mdadm source(?)</td> </tr> <tr> <td>0x4c</td> <td>76</td> <td>4</td> <td>layout</td> <td>layout of array
(RAID5 only)</td> <td>__u32</td> <td>(?)</td> <td>Only used
for RAID5</td> </tr> <tr> <td>0x50</td> <td>80</td> <td>8</td> <td>size</td> <td>used-size of component devices</td> <td>__u64</td> <td>size of component devices
(in # of 512-byte sectors)</td> <td></td> </tr> <tr> <td>0x58</td> <td>88</td> <td>4</td> <td>chunksize</td> <td>chunk-size of the array</td> <td>__u32</td> <td>chunk-size of the array
(in # of 512-byte sectors)</td> <td></td> </tr> <tr> <td>0x5c</td> <td>92</td> <td>4</td> <td>raid_disks</td> <td>(?)number of disks in array(?)</td> <td>__u32</td> <td>#</td> <td></td> </tr> <tr> <td>0x60</td> <td>96</td> <td>4</td> <td>bitmap_offset</td> <td># of sectors after superblock
that bitmap starts
(See note about signed value)</td> <td>__u32</td> <td>(signed)</td> <td>This is only valid if
feature_map[0] is set

Signed value allows bitmap
to appear before
superblock on the disk</td> </tr> <tr><td colspan="8"> </td></tr> <tr><td colspan="8">Special Section: for RAID-Reshape (Only valid if feature_map bit '4' is set)</td></tr> <tr> <td>0x64</td> <td>100</td> <td>4</td> <td>new_level</td> <td>(Used with RESHAPE)
the new RAID level being reshaped-to</td> <td>__u32</td> <td>See field named
"level" above</td> <td> </td> </tr> <tr> <td>0x68</td> <td>104</td> <td>8</td> <td>reshape_position</td> <td>(Used with RESHAPE)
Next address of the array to reshape</td> <td>__u64</td> <td>current position of the reshape operation</td> <td> </td> <tr> </tr> <td>0x70</td> <td>112</td> <td>4</td> <td>delta_disks</td> <td>(Used with RESHAPE)
this holds the change
in # of raid disks</td> <td>__u32</td> <td>change in # of raid disks</td> <td> </td> </tr> <tr> <td>0x74</td> <td>116</td> <td>4</td> <td>new_layout</td> <td>(Used with RESHAPE)
</td> <td>__u32</td> <td>new layout for array</td> <td> </td> </tr> <tr> <td>0x78</td> <td>120</td> <td>4</td> <td>new_chunk</td> <td>(Used with RESHAPE)
</td> <td>__u32</td> <td>new chunk size
(See )</td> <td> </td> </tr> <tr> <td>0x7c</td> <td>124</td> <td>4</td> <td>pad1</td> <td>Padding Block #1</td> <td>__u8[4]</td> <td>0</td> <td>Always set to
zero when writing</td> </tr> <tr><td colspan="8"> </td></tr> <tr><td colspan="8">Section: Constant "per-member-device" information block</td></tr> <tr> <td>0x80</td> <td>128</td> <td>8</td> <td>data_offset</td> <td>the sector # upon which data starts</td> <td>__u64</td> <td>sector # where data begins
(Often 0)</td> <td></td> </tr> <tr> <td>0x88</td> <td>136</td> <td>8</td> <td>data_size</td> <td>sectors in the device
that are used for data</td> <td>__u64</td> <td># of sectors that can be used for data</td> <td></td> </tr> <tr> <td>0x90</td> <td>144</td> <td>8</td> <td>super_offset</td> <td># of the sector upon
which this superblock starts</td> <td>__u64</td> <td># of the sector upon
which this superblock starts</td> <td></td> </tr> <tr> <td>0x98</td> <td>152</td> <td>8</td> <td>recovery_offset</td> <td>sectors before this offset
(from data_offset)
have been recovered</td> <td>__u64</td> <td>sector #</td> <td></td> </tr> <tr> <td>0xa0</td> <td>160</td> <td>4</td> <td>dev_number</td> <td>Fm</td> <td>__u32</td> <td>Dv</td> <td></td> </tr> <tr> <td>0xa4</td> <td>164</td> <td>4</td> <td>cnt_corrected_read</td> <td>Fm</td> <td>__u32</td> <td>Dv</td> <td></td> </tr> <tr> <td>0xa8</td> <td>168</td> <td>16</td> <td>device_uuid</td> <td>UUID of the member-device</td> <td>__u8[16]</td> <td>Dv</td> <td>Nt</td> </tr> <tr> <td>0xb8</td> <td>184</td> <td>1</td> <td>devflags</td> <td>Fm</td> <td>__u8</td> <td>Dv</td> <td></td> </tr> <tr> <td>0xb9 - 0xbf</td> <td>185 - 191</td> <td>7</td> <td>pad2</td> <td>Padding block</td> <td>__u8[7]</td> <td>0</td> <td>Always set to
zero when writing</td> </tr>


<tr><td colspan="8"> </td></tr> <tr><td colspan="8"> </td></tr> <tr><td>Remaining sections haven't been added to the wiki yet</td></tr> <tr> <td>Oh</td> <td>Od</td> <td>Lb</td> <td>Fn</td> <td>Fm</td> <td>Dt</td> <td>Dv</td> <td>Nt</td> </tr> </table>

Personal tools