Configuring a soft RAID-0 or RAID-1 during installation of the CentOS system

Source: Internet
Author: User

What is RAID-0

RAID-0 (isometric mode, stripe): Best performance. This model works better when it is made up of disks of the same size and capacity. This mode of RAID will first cut the disk out of the same amount of chunks (for example, 4KB), and then when a file to write to the raid, the file will be cut according to the size of the block, and then placed in each disk. Since each disk is interleaved with data, the data will be placed on each disk in equal amounts when your data is written to RAID. For example, you have two disks that make up RAID-0, and when you have 100MB of data to write, each disk is allocated to 50MB of storage. The RAID-0 is as follows:

means that each disk (disk A and Disk B) is first separated into a block (chunk) when the RAID-0 is composed. When data is written to RAID, the data is first cut to match the size of the cell block, and then one after another is placed on a different disk. Since the data has been first cut and placed on different disks sequentially, the amount of data per disk is reduced! In this case, the more RAID-0 the disk, the better the performance will be, because the amount of data that is responsible is even lower! This means that my data can be dispersed so that more than one disk to store, of course, the performance will become better AH! In addition, the total capacity of the disk has also become larger! Because the capacity of each disk will eventually be added to the total capacity of RAID-0!

Just use this level you have to bear the risk of data corruption, we know that the file is cut to fit the size of each partition block, and then placed in each disk. Think of it, if a disk is damaged, then the file data will be missing a piece, then this file is destroyed. Since each file is stored in this way, all data on the RAID will be lost and unreadable as long as any one of the RAID-0 disks is damaged.

In addition, if a disk of different capacity is used to compose the RAID-0, the data is placed in different disks in the same order, and when the chunk of the small capacity disk is exhausted, all the data will be written to the largest disk. For example, I use 200G and 500G composition RAID-0, then the original 400GB data can be written to two disks (each consumes 200G capacity), and then added to the data can only be written in the 500G of the disk. At this point, the effectiveness of the poor, because there is only one left to store data!

What is RAID-1

RAID-1 (mapping mode, mirror): Full backup. This mode also needs the same disk capacity, preferably the same disk! If the disk of different capacity is composed of RAID-1, then the total capacity will be the smallest one of the main disk! This model is basically "let the same data, intact on the two disk". For example, if I have a 100MB file and I have only two disks that make up the RAID-1, then the two disks will be written synchronously 100MB to their storage space. As a result, the overall RAID capacity is almost 50% less. Since the contents of the two hard drives are exactly the same as the mirrors, we also call him the mirror model.

As shown, a data transfer to RAID-1 is divided into two shares and written to each disk. Since the same data will be written to different disks separately, so if you are writing to 100MB, the data will be copied to each disk after the I/O bus, and the result is that the amount of data is feeling bigger! Therefore, in the case of large write RAID-1, the performance of the write may become very poor (because we only have one South bridge!). )。 Fortunately, if you are using a hardware RAID (disk array card), the disk array card will actively replicate a copy without using the system's I/O bus, performance is also possible. If you use a software disk array, you may not be able to function well.

Because the data in the two disks is identical, your data can still be intact when any one of the hard drives is damaged! So we can say that the biggest advantage of RAID-1 is probably the backup of the data! However, because half of the disk capacity is used for backup, the total capacity will be half the capacity of all disks. Although the write performance of RAID-1 is poor, the reading performance is OK! This is because two copies of the data are on different disks, and if multiple processes are reading the same data, RAID will get the best read balance on its own.
The above text turns from: http://vbird.dic.ksu.edu.tw/linux_basic/0420quota_2.php

System installation Process configuration raid

Below we take the CentOS 5.8, two hard drives/DEV/SDA and/dev/sdb as an example to operate.

1. Custom Partitioning

In the steps to "install a partition on your hard disk," Select "Create a custom partition structure"

2. Create a RAID partition

2.1 Create a RAID partition for/boot
Click on the "Raid" button, select "Create software RAID Partition", "OK" to take one step. Select "SDA" only in "allowed drives", size 100M, then click OK. Repeat the previous step by selecting only "SDB" in "Allowed drives", and the others are the same as in the previous operation.


2.2 Creating a RAID partition for swap
Depending on the 2.2 steps, only the size of the machine, such as memory 2G, can create 2G swap.
2.3 root directory/RAID partition creation
The remaining space is allocated to the root directory according to the 2.2 steps.
The final status is as follows:

3. Create a RAID device

3.1 Boot RAID device
Click "Raid", select "Create RAID Device" and click "OK". mount point Select "/boot", File system Type "EXT3", RAID Device "MD0", RAID Level "RAID1", RAID member select "Sda1 and SDB1" (can be judged by size is the boot created just now). Click "OK" to complete the boot RAID device creation.

3.2 Swap RAID device
Click "Raid", select "Create RAID Device" and click "OK". File system Type "swap", RAID device "MD1", RAID level "RAID0 or RAID1", RAID members Select "Sda2 and Sdb2" (can be judged by size is the swap created just now). Click "OK" to complete the creation of the swap RAID device.

3.3 Root RAID device
Click "Raid", select "Create RAID Device" and click "OK". mount point Select "/boot", File system Type "EXT3", RAID Device "MD2", RAID level "RAID0 or RAID1", RAID member select "Sda3 and Sdb3" (can be judged by size is the swap created just now). Click "OK" to complete the creation of the root RAID device.

The raid is created at this point and the final status is as follows:


Configuring a soft RAID-0 or RAID-1 during installation of the CentOS system

Related Article

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.