Introduction to Linux RAID configuration methods

Source: Internet
Author: User
Tags md5

One, zoning

Fdisk/dev/sdb//sdb for newly added disks

M View Command Menu
Mr. N expands the partition and then generates the logical partition
L represents logical partitioning
T set partition type FD (Auto RAID) 8e represents LVM
W Save exit
P Print out partition information
The above order can be divided into a good distinction.

Partprobe//Load new partition

Partx-a/dev/sdb//centos6 above with this command, you can see the newly added partition without rebooting
FDISK-L//view partitions

Second, create raid

Create md0
Mdadm-c/dev/md0-ayes-l0-n2/dev/sdb{5..6}////raid0

Mdadm-c/dev/md1-ayes-l1-n2/dev/sdb{7..8}//raid1

Mdadm-c/dev/md5-ayes-l5-n3/dev/sdb{9..11}//-x can heat a spare
Format md0
Mkfs.ext3/dev/md0

Three, Mount raid

Test
Mount/dev/md0/raid0
Unmout/dev/md0
Mount-a

Add Fstab
/DEV/MD0/RAID0 ext3 defaults 0 0
Add this configuration, otherwise reboot and find md0
echo device/dev/sdb[56] >/etc/mdadm.conf
Mdadm–detail–scan >>/etc/mdadm.conf
If an error occurs during reboot
Mdadm–stop/dev/md0

Four, the RAID5 test partition is broken

cp-rf/etc/*/raid5/
DD If=/dev/zero of=/raid5/file bs=1m count=100
Mdadm–manage/dev/md5–fail/dev/sdb11
Mdadm–manage/dev/md5–add/dev/sdb12–remove/dev/sdb11//sdb11 broken, put on SDB12
Mdadm:added/dev/sdb12

Vim/etc/amadm.conf also remember to add SDB12

V. View raid

Cat/proc/mdstat

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.