The 13th Chapter Linux Disk Management-raid

Source: Internet
Author: User

Common hard drives: SATA General pc mainstream HDD. SCSI general servers are widely used. The IDE is older and both are available.

RAID it means redundant array of inexpensive disks. is a collection of disks that are placed together to become a logical volume.

Software RAID and hardware RAID

Software RAID performance is low, use host resources, load RAID software, and read data from a software RAID volume. No physical hardware required, low cost.

Hardware RAID high performance, using PCIExpress card physics to provide a proprietary RAID controller. Do not use host resources. There is nvram for the read and write of the cache. The cache is used for RAID rebuilds, and the back battery power is used to keep the cache, even if a power failure occurs, but it is expensive.

Several concepts:

1. Stripe: Randomly store slice data to multiple disks. Use at least two disks.

2. Mirror: Image is used to automatically back up data. Save the same content to another disk.

3, Hot backup: Automatically replace the failed drive.

4, Block: the smallest unit of each read and write data.

5. Checksum: Used to regenerate lost content.

---------------------------------------------------------------

RAID 0: The size of 100M files to the raid on the hard disk, such as 2 fast hard disk RAID0, each write 50M, fast, hard drive bad, the data is also lost,

Raid 1:100m files, 2 fast hard drives are backed up, a piece is broken, another piece can be used, the speed drops

RAID 4 or RAID5 at least 3 fast drives

RAID 4: A hard drive is broken, the new drive is connected, the data is still there, but the speed may drop because all parity is on one hard drive

RAID 5: The parity is spread across all the different hard drives

---------------------------------------------------------------

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/8B/A3/wKioL1hTvM-TYhYWAAEpM5i7RuE277.png "title=" Raid0-5.png "style=" float:left; "alt=" Wkiol1htvm-tyhywaaepm5i7rue277.png "/>650" this.width=650; "src=" http:// S4.51cto.com/wyfs02/m02/8b/a7/wkiom1htvptil6vbaaa4mpnohkc722.png "title=" Raid10.png "alt=" Wkiom1htvptil6vbaaa4mpnohkc722.png "/>650) this.width=650;" Src= "http://s1.51cto.com/wyfs02/M00/8B/A3/ Wkiol1htvvaclqrwaabkr5hlr1g310.png "title=" read and write ability. png "alt=" Wkiol1htvvaclqrwaabkr5hlr1g310.png "/>



---------------------------------------------------------

Experiment one, create RAID0

Do not use the same hard disk partition to do raid, because if the disk is broken, the whole block is bad

After the RAID0 is created, you cannot add or delete the disk array, only rebuild, if the disk is broken, data loss 100%

Create a RAID 0 device: Use/DEV/SDB1/DEV/SDC1 to do experiments here

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

N P 1 T l FD W

Creates a sdb1 and specifies the type of FD

Also create/DEV/SDC1

Mdadm-c/DEV/MD0-L0-N2/DEV/SDB1/DEV/SDC1

-L designation level, RAID0, can RAID1, etc.

-n Specifies the device, RAID0 use two can strip.

Cat/proc/mdstat

Mkfs.ext4/dev/md0

Mkdir/mnt/raid0

mount/dev/md0/mnt/raid0/

# Vim/etc/fstab

Add the following entries and make your own modifications based on your installation location and the use of the file system.

/DEV/MD0/MNT/RAID0 ext4 deaults 0 0

After

Mdadm--detail--scan >>/etc/mdadm.conf If this is not the case, the md0 will become md127 after the reboot.


This article is from the "Asteroid" blog, please be sure to keep this source http://3203180.blog.51cto.com/3193180/1883462

The 13th Chapter Linux Disk Management-raid

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.