Create a disk array on Linux ——— RAID-5

Source: Internet
Author: User

RAID (Redundant array of inexpensive disks) is referred to as a disk array, combining multiple hard disks into a single logical sector, so that the performance of poor performance of the hard drives, to reach even more valuable, larger capacity of the hard disk. and increase the data integration, fault tolerance, processing capacity, capacity. This blog only describes the most commonly used RAID-5


RAID-5 Overview

In RAID5, you need at least 3 hard drives, because of the need for error checking, so the actual hard disk size should be the number of drives minus one, minus a space parity of the hard disk. The best capacity per hard drive is the same, RAID5 will split the data according to the smallest piece of hard disk capacity per hard drive, evenly allocated to each hard drive, as shown in:

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/A6/8D/wKioL1nS77qxbiatAADZMwJ1CgA916.png "title=" Yang Shufan 23.png "alt=" Wkiol1ns77qxbiataadzmwj1cga916.png "/>






Case: Creating a RAID-5 on red Hat Linux6.5

The RAID module is the kernel support module, the default configuration file is/etc/mdadm.conf, is the system kernel read by default

(1) First install 4 HDD on Linux,/dev/sdb/dev/sdc/dev/sdd/dev/sde each HDD 20G

(2) After the hard drive is installed, partition and format the hard disk, otherwise it cannot be used

(3) Use the MDADM command to create 4 hard disks as RAID5 volumes

# mdadm-c/dev/mdo-a yes-l 5-n 4-x 0/DEV/SD[BCDE]

-C = (create) creates raid

-L indicates level of RAID

-N denotes data for the (number) device

-x Specifies the number of spare device for the initial array

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/07/DE/wKiom1nTPzmCkH82AADHbTZm4ZM268.png "title=" Yang Shufan 24.png "alt=" Wkiom1ntpzmckh82aadhbtzm4zm268.png "/>


(4) View raid creation via mdadm-d/dev/md0

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/A6/8F/wKioL1nTQw2i8JujAACMUpb2a2A628.png "title=" Yang Shufan 25.png "alt=" Wkiol1ntqw2i8jujaacmupb2a2a628.png "/>


(5) Use fdisk/dev/md0 to re-partition the new/dev/md0, after partitioning the effect

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/07/DE/wKiom1nTRwKyLv0NAACllfuOOrY901.png "title=" Yang Shufan 26.png "alt=" Wkiom1ntrwkylv0naacllfuoory901.png "/>

(6) Do not forget to format the partition when you are finished creating it

# MKFS.EXT4/DEV/MD0P1


(7) Mount the RAID volume to the directory

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/A6/90/wKioL1nTSv-zreeBAAC1LEiBpyw442.png "title=" Yang Shufan 27.png "alt=" Wkiol1ntsv-zreebaac1leibpyw442.png "/>


(8) Add to the default mount file to automatically mount it with the system boot

# Vim/etc/fstab

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/A6/90/wKioL1nTUX-hmBkRAADhDHlST1Q074.png "title=" Yang Shufan 29.png "alt=" Wkiol1ntux-hmbkraadhdhlst1q074.png "/>

This way, the RAID-5 disk array is built.



This article is from the "Yang Shufan" blog, make sure to keep this source http://yangshufan.blog.51cto.com/13004230/1970347

Create a disk array on Linux ——— RAID-5

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: info-contact@alibabacloud.com 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.