RHEL5.4RAID5 software Disk redundancy array configuration details

Source: Internet
Author: User
RAID is an independent redundant disk array. The redundant disk array technology was born in 1987 and was proposed by the University of California at Berkeley. Simply put, N hard disks are combined into a single virtual large-capacity hard disk using RAIDController (Hardware, Software. The adoption of RAID brings huge benefits to the storage system (or internal storage of servers), which improves the transmission rate and improves

RAID is an Independent Redundant Disk Array. The redundant disk array technology was born in 1987 and was proposed by the University of California at Berkeley. A simple explanation is to combine N hard disks with RAID Controller (Hardware, Software) into a single virtual large-capacity hard disk. RAID brings huge benefits to the storage system (or internal storage of servers). Increasing the transmission rate and fault tolerance are the biggest advantages. raid mainly includes RAID 0, raid1, raid4, raid5, etc, 5 is actually developed on the basis of 4, 4 Write the parity check on the same disk, resulting in performance bottlenecks, 5 scattered validation data, improve performance, 1 is a simple image, and 50% of the space is wasted. 0 is all the disks in the Data transparently written array, which is fast but insecure. To sum up, raid1 is the safest, but it is a waste of space. raid0 has the best performance and does not waste space, but has poor security. raid5 can be said to be equal to raid1 and raid0, but requires more than three disks or partitions, the disk usage is n-1, and a large partition is required. The following is a systematic introduction to configuring raid5 on rhel5.4. This configuration step has been recorded before, but many details are not recorded. This is important in rhce and cannot be ignored...

1. Use the fdisk tool to divide the disk into four other large partitions and convert them to the fd format.
[Root @ yang ~] # Fdisk-l | grep raid
/Dev/hda5 5178 5300 987966 fd Linux raid autodetect
/Dev/hda6 5301 5423 987966 fd Linux raid autodetect
/Dev/hda7 5424 5546 987966 fd Linux raid autodetect
/Dev/hda8 5547 5669 987966 fd Linux raid autodetect

2: Create a block device, mainly considering that a system may have multiple raid Arrays
[Root @ yang ~] # Mknod/dev/md1 B 9 1
[Root @ yang ~] # Ls-li/dev/md *
5162 brw-r ----- 1 root disk 9, 0 Mar 6/dev/md0
10616 brw-r -- 1 root 9, 1 Mar 6/dev/md1

3: create a raid5 array.-C indicates create,-l indicates level,-n indicates the number of partitions in the array, and-x indicates sapre partitions.
[Root @ yang ~] # Mdadm-C/dev/md1-l 5-n 3/dev/hda {5, 6, 7}-x 1/dev/hda8
Mdadm: array/dev/md1 started.

During the creation process, you can use the watch command to observe the changes to the/proc/mdstat file.
[Root @ yang ~] # Watch-n 1 "cat/proc/mdstat"
Every 1.0 s: cat/proc/mdstat Sat Mar 6 18:23:30 2010

Personalities: [raid6] [raid5] [raid4]
Md1: active raid5 hda7 [4] hda8 [3] (S) hda6 [1] hda5 [0]
1975680 blocks level 5, 64 k chunk, algorithm 2 [3/2] [UU _]
[======>...] Recovery = 34.8% (344156/987840) finish = 0.2 min sp
Eed = 49165 K/sec

Unused devices:

4. format the partition.
[Root @ yang ~] # Mkfs. ext3/dev/md1
......................................................
......................................................
This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs-c or-I to override.
[Root @ yang ~] # Tune2fs-c 0-I 0-o acl/dev/md1 // After the partition is formatted by default, the system will perform self-check after the partition is mounted 34 times or 180 days, the default format does not contain the acl parameter.
Tune2fs 1.39 (29-may-2006)
Setting maximal mount count to-1
Setting interval between checks to 0 seconds

5. Mount the partition and View Details.

[Root @ yang ~] # Mkdir/data

[Root @ yang ~] # Mount/dev/md1/data/

[Root @ yang ~] # Df-h | grep data

/Dev/md1 1.9G 35 M 1.8G 2%/data

[Root @ yang ~] # Mdadm -- detail/dev/md1 | tail-n 5

0 3 5 0 active sync/dev/hda5

1 3 6 1 active sync/dev/hda6

2 3 7 2 active sync/dev/hda7

3 3 8-spare/dev/hda8

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.