RAID superblock formats

From Linux Raid Wiki
(Difference between revisions)
Jump to: navigation, search
Line 170: Line 170:
 
</tr>
 
</tr>
 
<tr><td colspan="8">&nbsp;</td></tr>
 
<tr><td colspan="8">&nbsp;</td></tr>
<tr>
+
<tr><td colspan="8">Special Section: for RAID-Reshape (Only valid if feature_map bit '4' is set)</td></tr>
<td colspan="8">Special Section: for RAID-Reshape (Only valid if feature_map bit '4' is set)</td>
+
</tr>
+
 
<tr>
 
<tr>
 
<td>0x94</td>
 
<td>0x94</td>
Line 233: Line 231:
 
<td>Always set to<br>zero when writing</td>
 
<td>Always set to<br>zero when writing</td>
 
</tr>
 
</tr>
 +
<tr><td colspan="8">&nbsp;</td></tr>
 +
<tr><td colspan="8">Section: Constant "per-member-device" information block</td></tr>
 +
<tr>
 +
<td>0xb0</td>
 +
<td>Od</td>
 +
<td>Lb</td>
 +
<td>Fn</td>
 +
<td>Fm</td>
 +
<td>Dt</td>
 +
<td>Dv</td>
 +
<td>Nt</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>
 +
<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>
 +
 +
 +
<tr><td colspan="8">&nbsp;</td></tr>
 
<tr><td colspan="8">&nbsp;</td></tr>
 
<tr><td colspan="8">&nbsp;</td></tr>
 
<tr><td>Remaining sections haven't been added to the wiki yet</td></tr>
 
<tr><td>Remaining sections haven't been added to the wiki yet</td></tr>

Revision as of 19:38, 22 February 2008

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>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
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>0x8c</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>0x90</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>0x94</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>0x98</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>0xa0</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>0xa4</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>0xa8</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>0xac</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>0xb0</td> <td>Od</td> <td>Lb</td> <td>Fn</td> <td>Fm</td> <td>Dt</td> <td>Dv</td> <td>Nt</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> <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>


<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