Skip to content

Commit

Permalink
Document hot-replacement to resize mdadm partitions
Browse files Browse the repository at this point in the history
With mdadm 3.3 or newer, partitions can be hot-replaced with new disks so that the array remains fault-tolerant through the replacement process.
  • Loading branch information
Grinnz authored and lvicoun committed Oct 10, 2024
1 parent 689b1b1 commit 6b34a65
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions xml/storage_mdadm-resize.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,39 @@
</para>
</step>
</procedure>
<para>
Alternatively, if you are replacing the disks and can install the new disks
temporarily alongside the existing array, you can hot-replace the
partitions. This will keep them in service until a new partition has been
rebuilt as a spare, so the array does not enter a degraded state and
remains fault-tolerant during the process. The following steps replace
steps 3&ndash;5 in the above procedure.
</para>
<procedure>
<step>
<para>
Mark a component partition for replacement. For example, to replace
<filename>/dev/sda1</filename>, enter
</para>
<screen>&prompt.sudo;mdadm /dev/md0 --replace /dev/sda1</screen>
</step>
<step>
<para>
Add a replacement partition to the RAID array. For example, to add
<filename>/dev/sdd1</filename>, enter
</para>
<screen>&prompt.sudo;mdadm -a /dev/md0 /dev/sdd1</screen>
</step>
<step>
<para>
Once the new partition has been added and has finished rebuilding, the
partition marked for replacement will be automatically marked as faulty,
and can be removed from the array. For example, to remove
<filename>/dev/sda1</filename>, enter
</para>
<screen>&prompt.sudo;mdadm /dev/md0 --remove /dev/sda1</screen>
</step>
</procedure>
</sect2>

<sect2 xml:id="sec-raid-resize-incr-raid">
Expand Down

0 comments on commit 6b34a65

Please sign in to comment.