Linux disk array technical details (iii) creation of--raid 5 and RAID 10

Source: Internet
Author: User

First Look at RAID 5:

650) this.width=650; "src=" Http:// "title=" Qq20161201155535.png "alt=" Wkiol1g_187do3oraadqlz1fnay205.png "/>

① partition

650) this.width=650; "src=" Http:// "title=" Qq20161201163908.png "alt=" Wkiol1g_4aexfq4_aablhgbhcsm143.png "/>

② Creating RAID 5

Mdadm-c-v/dev/md5-l 5-n 3-x 1/dev/sde{1,2,3,4}

650) this.width=650; "src=" Http:// "title=" Qq20161201164817.png "alt=" Wkiom1g_48bgjhjtaacefptmtuq457.png "/>

③ Analog disk failure

This is actually the same as the disk fault handling method in RAID 1.


650) this.width=650; "src=" Http:// "title=" Qq20161201170209.png "alt=" Wkiom1g_5wghpluhaaavhgowb8w413.png "/>

Take a look at what's in/proc/mdstat:

650) this.width=650; "src=" Http:// "title=" Qq20161201170304.png "alt=" wkiom1g_5zvw4z42aabscziry1g694.png "/> Haha, see! It's been changed, Oh!

Come on, delete the failed disk command as follows:

650) this.width=650; "src=" Http:// "title=" Qq20161201170434.png "alt=" Wkiom1g_55pbnu82aabdwbkmnaw974.png "/>

OK, Next I'll teach you how to stop the array:

Note, don't forget to build the configuration file.

650) this.width=650; "src=" Http:// "title=" Qq20161201170934.png "alt=" Wkiom1g_6l_yiayaaabgbaa-r0c363.png "/>

The command to stop the array is: Mdadm-s/dev/md*

For example: I want to stop RAID 5 and operate as follows:

650) this.width=650; "src=" Http:// "title=" Qq20161201171047.png "alt=" Wkiom1g_6qnga1hnaaapmc7l_uk842.png "/>

To activate a RAID 5 array:

650) this.width=650; "src=" Http:// "title=" Qq20161201171445.png "alt=" Wkiom1g_6fjance_aaagvfpekn4944.png "/>

Note that the configuration file needs to be read when it is activated, so be sure to write the configuration file before stopping the array.

After the format, mount use I will not repeat it! Below I list the situation after the mount is used:

650) this.width=650; "src=" Http:// "title=" Qq20161201171943.png "alt=" Wkiom1g_6x7wwthaaabok-hsel4617.png "/>

Here's how to add a disk to the array, first unload the Mount directory, and then add a disk to the array, where we use/DEV/SDE6 to simulate a disk.

650) this.width=650; "src=" Http:// "title=" Qq20161201172504.png "alt=" Wkiom1g_7gpw8xiuaabj3armslu235.png "/>

The disk added above acts as a hot spare, how can I extend it to a directly used disk?

650) this.width=650; "src=" Http:// "title=" Qq20161201173524.png "alt=" Wkiom1g_7uxawsvhaaayfqpydiq718.png "/>

650) this.width=650; "src=" Http:// "title=" Qq20161201173616.png "alt=" Wkiol1g_7wkxvwvoaabktl3d4ba045.png "/>

Remember to write the configuration file in the end!

Mdadm-ds >/etc/mdadm.conf

650) this.width=650; "src=" Http:// "title=" Qq20161201173839.png "alt=" Wkiom1g_74-jv92maabgoxllitu583.png "/>

OK, it's done!

RAID5 is our work in the operation of the use of a more commonly used methods, ah, you must have heard of a RAID10 called the double-layer architecture mode, in fact, it is a raid 1+0 mode.

RAID10 principle: Create the RAID1 first, then create the RAID0 with the RAID1 device you just created.

The simple thing is to create two RAID 1 and then make two RAID 1 into a RAID 0 mode.

Let's do an experiment (because we already have RAID 1 and RAID 0 in front of us, so here we use RAID 11来 instead of RAID1 and raid 10来 instead of RAID 0):

① Creating partitions

Method is the same as the previous method of creating the partition, which is not explained here. Here I have created 4 primary partitions, as follows:

650) this.width=650; "src=" Http:// "title=" Qq20161201174652.png "alt=" Wkiol1g_8ydgor_oaabdhhnwxti714.png "/>

② creation of two RAID 1 devices

650) this.width=650; "src=" Http:// "title=" Qq20161201175713.png "alt=" Wkiom1g_9ayamlzjaacs8iinv1s983.png "/>

③ Creating a RAID0 array

650) this.width=650; "src=" Http:// "title=" Qq20161201175952.png "alt=" Wkiol1g_9iqt3wypaacbl3lw52g198.png "/>

Also remember to write the configuration file Oh!

650) this.width=650; "src=" Http:// "title=" Qq20161201180204.png "alt=" Wkiol1g_9qzsj1o5aabyyblgns4467.png "/> and then I'll tell you a command to stop all arrays:


650) this.width=650; "src=" Http:// "title=" Qq20161201180324.png "alt=" Wkiom1g_9v3t0_kaaab-mmoa68s265.png "/> above/dev/md0 and/DEV/MD1 did not stop properly because you need to uninstall the directory first to stop!

Finally, let us explain how to delete the soft raid!

For example: We want to delete a md1 array that has already been created:

The steps are as follows:

① Uninstall Directory

650) this.width=650; "src=" Http:// "title=" Qq20161201181324.png "alt=" Wkiol1g_97ws3kf9aaaj0wuqodm008.png "/>

② Stop RAID device

650) this.width=650; "src=" Http:// "title=" Qq20161201181502.png "alt=" Wkiom1g_-bjbbguqaaapckbx3ti059.png "/>

This can also be done directly with the MDADM-SS command.

③ Deleting a RAID profile/etc/mdadm.conf

650) this.width=650; "src=" Http:// "title=" Qq20161201181636.png "alt=" Wkiom1g_-herfk0caaaluno01xe321.png "/>

④ clear the RAID identity on the disk

For example, the disk in RAID 1 is SDC1,SDC2,SDC3, the command is as follows:

650) this.width=650; "src=" Http:// "title=" Qq20161201182013.png "alt=" Wkiol1g_-vwxa1ymaaajbwd3nou755.png "/>

The parameter description in step ④:

650) this.width=650; "src=" Http:// "title=" Qq20161201182112.png "alt=" Wkiom1g_-yvwmpgjaacsb74k-xm201.png "/>

Our RAID series is over, little friends! Come on, let's go practice! If there is anything I do not understand the place to leave a message, I sparing!

This article is from the "Brother Hong Linux World" blog, so be sure to keep this source

Linux disk array technical details (iii) creation of--raid 5 and RAID 10

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.