002. Raid Creation

Source: Internet
Author: User
1. Create the corresponding Partition
1 [[email protected] ~] # Fdisk/dev/SDB 2 finally creates multiple partitions for raid as follows: 3 device boot start end blocks ID system 4/dev/sdb1 2048 10485759 5241856 5 Extended 5/dev/sdb5 4096 2101247 1048576 83 Linux 6/dev/sdb6 2103296 4200447 83 Linux 7/ dev/sdb7 4202496 6299647 1048576 83 Linux 8/dev/sdb8 6301696 8398847 1048576 83 Linux

2. Create a raid

1. If the raid management tool is not installed, install the raid management tool Yum-y install mdadm first.

2 raid can be used for partitioning and disk operations, where the disk is equal to the partition

1 [[email protected] ~] # Mdadm-C/dev/md0-L5-N3-x1/dev/SDB {5, 6, 7, 8} 2 # create RAID5 with three disks, set one backup disk (partition ). 3 mdadm: defaulting to version 1.2 metadata 4 mdadm: array/dev/md0 started. 5 [email protected] ~] # Mdadm-C/dev/md0-L1-N2/dev/SDB {5, 6} # create RAID 1 for two disks. 6 mdadm-C/dev/MD5-L5-N4/dev/sdb1/dev/sdc1/dev/sdd1/dev/sde1 7 8 mdadm: /dev/sdb5 appears to be part of a raid array: 9 ...... 10 -- metadata = 0.90 # This prompt indicates that if this raid group is used as the boot partition, it may not be able to be started. If you ignore this prompt, you can perform 11 ...... 12 continue creating array? Y 13 ...... 14 mdadm: array/dev/md0 started.

Note:

  • The number of RAID 1 disks (partitions) is recommended to be an even number. it is meaningless to create an odd number of images.
  • RAID 5 has at least three disks.
3. modify the configuration file
1 [[email protected] ~] # Mdadm-ds/dev/md0>/etc/mdadm. conf # It is strongly recommended to write the md0 array to the configuration file to prevent the md0 from identifying errors after restart. 3 [[email protected] ~] # Cat/etc/mdadm. conf 4 array/dev/md0 metadata = 1.2 name = kauai.example.net: 0 UUID = 9235e2c7: 3c94f2d8: 72d806f3: af0792fb

4. Format and Mount

Format raid according to file format

1 [[email protected] ~] # Mkfs. XFS/dev/md0 # format raid 2 [[email protected] ~] # Mkdir myraid5 # create a directory for mounting 3 [[email protected] ~] # Mount/dev/md0/root/myraid5 # Mount partition 4 [email protected] ~] # DF-H 5 filesystem size used avail use % mounted on 6 ...... 7/dev/md0 3.0g 33 m 3.0g 2%/root/myraid5 # mounting successful

5 boot mounting
1 [[email protected] ~] VI/etc/fstab # It is recommended to modify the Mounting Mode at startup 2/dev/md0/root/myraid5xfsdefaults0 0

002. Raid Creation

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.