Build RAID

<p class="shortdesc"></p> <section class="section prereq" id="Build__prereq_qq5_5p4_tlb"><div class="tasklabel"><h2 class="doc-tairway">Before you begin</h2></div> <p class="p">You have created EBS disks and mounted them to the corresponding cloud servers. For more information, see <a class="xref" href="https://pinganyun.com/ssr/help/storage/ebs/quickstart.createdrive.separately" target="_blank">Create an EBS Disk</a>.</p> </section> <section class="section context" id="Build__context_ing_5p4_tlb"><div class="tasklabel"><h2 class="doc-tairway">About this task</h2></div> <p class="p">This chapter takes four EBS disks, namely /dev/vdd, /dev/vde, /dev/vdf, and /dev/vdg, as examples to illustrate how to create RAID10. As shown below, the system has been mounted with four EBS disks, and each EBS disk is roughly 20G in size.</p> <img class="image" id="Build__image_vym_z54_tlb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20200707171843-1b4560569056.png"> </section> <section id="Build__steps_bgk_1v4_tlb"><div class="tasklabel"><h2 class="doc-tairway">Procedure</h2></div><ol class="ol steps" id="Build__steps_bgk_1v4_tlb"><li class="li step stepexpand"> <span class="ph cmd">Log in to the ECS as user root.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Install mdadm. </span> <div class="itemgroup info"> <pre class="pre codeblock"><code>yum install mdadm -y</code></pre> <img class="image" id="Build__image_ixm_wz4_tlb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20200707171843-1348fe6d95d2.png" width="800"> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Create a RAID array. </span> <div class="itemgroup info"> <pre class="pre codeblock"><code>mdadm -Cv  <RAID array device name> -a yes -n <Disk quantity>  -1 RAID<Level> <Disk1> <Disk2> <Disk 3>...</code></pre> <p class="p">Example of the command</p> <pre class="pre codeblock"><code>mdadm -Cv /dev/md0 -a yes -n 4 -1 10 /dev/vdd /dev/vde /dev/vdf /dev/vdg</code></pre> <img class="image" id="Build__image_y2g_b1p_tlb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20200707171843-10d7f9669f42.png" width="800"> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Format the RAID array. </span> <div class="itemgroup info"> <pre class="pre codeblock"><code>mkfs.<File system format><RAID array device name></code></pre> <p class="p">Example of the command</p> <pre class="pre codeblock"><code>mkfs.ext4 /dev/md0</code></pre> <img class="image" id="Build__image_kgh_qbp_tlb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20200707171843-170b8fd3959e.png" width="800"> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Create a mount directory.</span> <div class="itemgroup info"> <pre class="pre codeblock"><code>mkdir <Mount directory></code></pre> <p class="p">Example of the command</p> <pre class="pre codeblock"><code>mkdir /RAID10</code></pre> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Mount the RAID array device name. </span> <div class="itemgroup info"> <pre class="pre codeblock"><code>mount <RAID array device name> <Mount directory></code></pre> <p class="p">Example of the command</p> <pre class="pre codeblock"><code>mount /dev/md0 /RAID10</code></pre> </div> </li><li class="li step stepexpand"> <span class="ph cmd">View the mount result of the RAID array. </span> <div class="itemgroup info"> <pre class="pre codeblock"><code>df -h</code></pre> <img class="image" id="Build__image_c4n_sbp_tlb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20200707171843-1fd63aff96f8.png" width="800"> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Enable automatic mount of the RAID array when the system starts. </span> <div class="itemgroup info"> <ol class="ol" type="a" id="Build__ol_skl_z1p_tlb"> <li class="li">Run the command <code class="ph codeph">vi /etc/fstab</code>, and then open /etc/fstab. </li> <li class="li">Enter <code class="ph codeph">i</code> to enter the editing mode. </li> <li class="li">Add a row to the end of the file, and then enter <code class="ph codeph">dev/md0 /RAID10 ext4 defaults 0 0</code>. <img class="image" id="Build__image_lyk_tbp_tlb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20200707171844-11cd29cf9c43.png" width="800"></li> <li class="li">After that, press “Esc”, enter <code class="ph codeph">:wq</code>, save and exit the file. </li> </ol> </div> </li><li class="li step stepexpand"> <span class="ph cmd">View the RAID array information. </span> <div class="itemgroup info"> <pre class="pre codeblock"><code>mdadm <RAID array device name></code></pre> <p class="p">Example of the command</p> <pre class="pre codeblock"><code>mdadm -D /dev/md0</code></pre> <img class="image" id="Build__image_tbd_xbp_tlb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20200707171844-18e8b4f09d79.png" width="800"> </div> </li></ol></section>
Did the above content solve your problem? Yes No
Please complete information!

Call us

400-151-8800

Email us

cloud@pingan.com

Online customer service

Instant reply

Technical Support

cloud products