Linux beginner-disk array Chapter

Source: Internet
Author: User

Linux Beginner-disk array Chapter

In the use of disk, sometimes need to increase the disk read and write data speed, it is necessary to use the disk group--raid, that is, the disk array.

The disk array is made up of at least two disks, and there are many modes of RAID, where the commonly used patterns RAID0, RAID1, and RAID5 are described.

RAID0:RAID0 is used to improve the speed of reading data, which is composed of more than two disks, the data is recorded in these disks, when used, a few disks each read part of the data. This disk group is identical to the amount of data that needs to be deposited, so the capacity and size of a disk are the same, but the read speed becomes faster.

RAID1:RAID1 is used to increase the speed of writing data, is the number of copies of the data into the disk when the data is divided into several pieces of disk, each disk is incomplete data, so the capacity of this disk group will be doubled, the speed of writing data will also become faster.

RAID5:RAID5 is essentially a combination of RAID0 and RAID1, which increases the speed of both reading and writing data, but the speedup is not as high as RAID0 or RAID1.

In learning, the disk array is a program to make several partitions into RAID, this disk array to read and write speed is far less than the speed of using a few disks.

Before a disk array is established, the disk needs to be partitioned to three three partitions of the same size. Take RAID1 as an example, the command to set up a disk array is "Mdadm-c/dev/md0-a yes-l 1-n 2-x 1/dev/vdb{1..3}" where "-c/dev/md0" means creating a raid named/dev/md0, "-a Yes" table To determine that there is no automatic establishment, "-L 1" is established as RAID1, "-N 2" means the use of two hard disk is established, "X 1" means the spare disk is a piece, "dev/vdb{1..3}" represents three disk partitions.

According to, see after the creation, disk partition 1 and disk partition 2 began to synchronize data, the completion of the format "/dev/md0" after completion can be mounted.

"Mdadm-d/dev/md0", you can view the details of the disk array.

The purpose of the backup disk is that after a piece of disk is damaged, the standby disk automatically complements the start synchronization data, the main thing is that there is no impact on the mount at this time, that is, during the replacement raid can continue to use. As shown in. Enter the command "Mdadm/dev/md0-f/dev/vdb1" to invalidate disk partition 1, and then the standby disk will start synchronizing with disk partition 2. "Mdadm/dev/md0-r/dev/vdb1" can delete disk partition 1, "Mdadm/dev/md0-a/dev/vdb1" can add disk partition 1.

After the disk array is used, you need to delete the disk array, cancel the disk mount, then enter "Mdadm-s/dev/md0" to delete the established disk array, and finally delete the partition.

Linux beginner-disk array Chapter

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.