Create RAID1 under Linux

Source: Internet
Author: User

Experiment

Add two blocks30GHDD

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/45/DD/wKiom1PssurBCkjNAAMGRufngjM762.jpg "title=" Snap569.jpg "alt=" wkiom1pssurbckjnaamgrufngjm762.jpg "/>650" this.width=650; "src=" http://s3.51cto.com/wyfs02/ M02/45/dd/wkiom1pssygq-qgiaajfvs4llr0852.jpg "title=" 1.jpg "alt=" Wkiom1pssygq-qgiaajfvs4llr0852.jpg "/>

without restarting, let the The Linux system recognizes the newly added disk

connect to Linux operations server using putty

[Email protected] ~]# fdisk–l

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/45/DD/wKiom1Pssz2i9R2sAAUR8O2m1lQ132.jpg "title=" 2.jpg " alt= "Wkiom1pssz2i9r2saaur8o2m1lq132.jpg"/>

No newly added two disks identified

[Email protected] ~]# echo "---" >/sys/class/scsi_host/host0/scan

[Email protected] ~]# echo "---" >/sys/class/scsi_host/host2/scan

[Email protected] ~]# echo "---" >/sys/class/scsi_host/host3/scan

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/45/DF/wKioL1PstG7h91r9AALP4eNfinU918.jpg "title=" 3.jpg " alt= "Wkiol1pstg7h91r9aalp4enfinu918.jpg"/>

partition for two hard disks

[Email protected] ~]# fdisk/dev/sdb

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/45/DD/wKiom1Pss3bwkwyDAAEns4Gu2mA873.jpg "title=" 4.jpg " alt= "Wkiom1pss3bwkwydaaens4gu2ma873.jpg"/>

[Email protected] ~]# FDISK/DEV/SDC

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/45/DF/wKioL1PstKzTNl8yAAHWDdxhVr4314.jpg "title=" 5.jpg " alt= "Wkiol1pstkztnl8yaahwddxhvr4314.jpg"/>

[[Email protected]]# mkfs.ext4/dev/sdb1

[[Email protected]]# MKFS.EXT4/DEV/SDC1

CreateRaid1

[[email protected] ~]# Mdadm-cv/dev/md0-l1-n2-c128/dev/sd[b,c]

Mdadm:array/dev/md0 started.

To format

[Email protected] ~]# mkfs.ext4/dev/md0

Create a directory DATA

[Email protected] ~]# mkdir DATA

then mount the/dev/md0 to the DATA directory .

[Email protected]~]# mount/dev/md0 DATA

Edit Settings Auto Mount

[[Email protected]~]# Vi/etc/fstab

at the end of the add /dev/md0/data ext4 defaults 0 0

reboot Restart

Analog Failure

Delete a piece of hard disk, keep only another piece of RAID1

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/45/DD/wKiom1Pss63Th5YxAAIhLd7bbys587.jpg "title=" 6.jpg " alt= "Wkiom1pss63th5yxaaihld7bbys587.jpg"/>

You can also view the files that are written

650) this.width=650; "Width=" 554 "height=" "src=,"/e/u261/themes/default/images/spacer.gif, "alt=" snap576.bmp "style = "Background:url ("/e/u261/lang/zh-cn/images/localimage.png ") no-repeat center;border:1px solid #ddd;"/>

and re-join a hard drive.

[Email protected] ~]# mdadm /dev/md0-a/dev/sdb1


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.