Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux RAID Set RAID 10 or 0 + 1     - Examples of RAID levels and achieve Operational Details (Linux)

- Hadoop1.2.1 plug compilation (Server)

- C # DateTime structure common method (Programming)

- Linux kernel boot to retain large memory method summary (Linux)

- Linux ACL permissions (Linux)

- The AWK use Cygwin tools mysql binlog log viewer (Database)

- Use the vi text editor and copy and paste Linux tips (Linux)

- Ubuntu Linux use ufw or iptables firewall configuration (Linux)

- Use Ansible installation NGINX and NGINX Plus (Server)

- Shell scripts quickly deploy Tomcat project (Server)

- Linux find command to find files (Linux)

- CentOS 6 Install Linux kernel source (Linux)

- SSH automatic disconnection problem solving (Linux)

- Spring JDBC Comments (Programming)

- Basic data types JavaScript type system and the type of packaging (Programming)

- Hibernate Search and Lucene quick introduction (Linux)

- Configuring Eclipse Note Templates (Linux)

- How to merge two pictures in Cacti (Linux)

- OpenSSL: implementation creates a private CA, certificate signing request Explanation (Server)

- MySQL flip-flop (Database)

 
         
  Linux RAID Set RAID 10 or 0 + 1
     
  Add Date : 2017-01-08      
         
       
         
  RAID 10 is a combination of RAID 1 and RAID 0 is formed. To set up RAID 10, we need at least four disks. In the previous article, we have seen how to use a minimum of two disk set RAID 1 and RAID 0.

Here, we will use a combination of a minimum of four disk RAID 1 and RAID 0 set to RAID 10. Suppose we have a logical volume with RAID 10 is created to save some data. For example, we want to save the data "TECMINT", it uses the following method to save four disks.

Create Raid 10 in Linux

RAID 10 is mirrored to do first, do the strip. Therefore, RAID 1, the same data is written to two disks, "T" will also be written to the first and second disk. Then the data is striped across two disks, "E" will be simultaneously written to the third and fourth disk. This process will continue to cycle, "C" will also be written to the first and second disk, and so on.

(LCTT Annotation: text described herein confusion is wrong, it has been modified according to the actual situation.)

Now that you know how the combination of RAID 1 RAID 10 and RAID 0 to work again. If we have four 20 GB disks for a total of 80 GB, but we will only get 40 GB of capacity, the other half of the capacity lost in the 10 build RAID.

Advantages and disadvantages of RAID 10

Provide better performance.
In RAID 10, we will lose half of the disk capacity.
Read and write performance is very good, because it will also be written and read.
Database can solve high I / O disk writes.
Claim

In RAID 10, we need at least four disks, the first two disks as RAID 1, the other two disks as RAID 0, like I said before, only RAID 10 is a combination of RAID 0 and 1. If we need to expand RAID group, you need to add a minimum of four disks.

My server settings

Operating System: CentOS6.5Final
IP Address: 192.168.0.229
Host Name: rd10.tecmintlocal.com
Disk 1 [20GB]: / dev / sdd
Disk 2 [20GB]: / dev / sdc
Disk 3 [20GB]: / dev / sdd
Disk 4 [20GB]: / dev / sde
There are two ways to set up RAID 10, where I will demonstrate two methods, but I prefer the first method, use it to set the RAID 10 easier.

Method 1: Set RAID 10

1. First, use the following command to confirm the added four disk is not in use.

# Ls-l / dev | grep sd
2, four disks are detected, and then to check whether there RAID disk partitions.

# Mdadm-E / dev / sd [b-e]
# Mdadm - examine / dev / sdb / dev / sdc / dev / sdd / dev / sde # or

Verify added four disks

Note: In the above output, if not detected super-block means is not defined in the four disks through RAID.

Step 1: RAID partition

3. Now, using fdisk, command four disks (/ dev / sdb, / dev / sdc, / dev / sdd and / dev / sde) to create a new partition.

# Fdisk / dev / sdb
# Fdisk / dev / sdc
# Fdisk / dev / sdd
# Fdisk / dev / sde

Creating a partition for / dev / sdb

I'll tell you how to use fdisk disk (/ dev / sdb) partition, this step is also applicable to other disks.

# Fdisk / dev / sdb
Use the following steps to create a new partition for / dev / sdb.

Create a new partition by n.
Then press P to select a primary partition.
Next, select the partition number 1.
Simply press the Enter key twice to select the default value.
Then, press P to print the created partition.
Press L, lists all the available types.
Press t to modify the partition.
Type fd is set to Linux RAID type, and then press Enter to confirm.
Then use p again see our changes.
Use w to save your changes.

Sdb disk partition

Note: Use the same instructions above to other disk (sdc, sdd sdd sde) partition.

4. Once you've created four partitions, use the following command to check whether there is a disk raid.

# Mdadm-E / dev / sd [b-e]
# Mdadm - examine / dev / sdb / dev / sdc / dev / sdd / dev / sde # or
# Mdadm-E / dev / sd [b-e] 1
# Mdadm - examine / dev / sdb1 / dev / sdc1 / dev / sdd1 / dev / sde1 # or

Check Disk

Note: The above output shows the four newly created partition is not detected in the super-block, which means that we can continue to create RAID 10 on these disks.

Step 2: Create a RAID device md

5, now create a md (ie, / dev / md0) device, the use of "mdadm" raid management tools. Before you create a device, you must ensure that the system has been installed mdadm tool, if not please use the following command to install.

#yum install mdadm [in RedHat System]
# Apt-get install mdadm [in Debain system]
Mdadm tool after installation is complete, you can use the following command to create an md raid device.

# Mdadm - create / dev / md0 --level = 10 - raid-devices = 4 / dev / sd [b-e] 1
6, then use the cat command to verify that the newly created raid device.

# Cat / proc / mdstat

Create md RAID device

7. Next, use the following command to check the four disks. The following command output will be very long, because it will show all the information four disks.

# Mdadm - examine / dev / sd [b-e] 1
8. Next, use the following command to view detailed information about the RAID array.

# Mdadm - detail / dev / md0

See RAID Array details

Note: You can see in the above results, the status of the RAID is active and re-syncing.


Step 3: Create a file system

9, the use ext4 as md0 'file system, and mount it to the next / mnt / raid10`. Here, I use ext4, you can use the file system type you want.

# Mkfs.ext4 / dev / md0

Create a file system md

10, after you create a file system, mount the file system to the next / mnt / raid10, and use the ls -l command to list the contents of the mount point under.

# Mkdir / mnt / raid10
# Mount / dev / md0 / mnt / raid10 /
# Ls-l / mnt / raid10 /
Next, create the mount point in some files, and add some content in the document, and then check the contents.

# Touch / mnt / raid10 / raid10_files.txt
# Ls-l / mnt / raid10 /
#echo "raid 10 setup with 4 disks"> / mnt / raid10 / raid10_files.txt
# Cat / mnt / raid10 / raid10_files.txt

Mount md devices

11, in order to automatically mount, open / etc / fstab file and add the following entries, depending on your environment mount point to add. Use wq! To save and exit.

# Vim / etc / fstab
/ Dev / md0 / mnt / raid10 ext4 defaults 00

Mount md devices

12, next, to verify whether the / etc / fstab file for errors before restarting the system using mount -a.

# Mount-av

Check Fstab errors

Step Four: Save the RAID configuration

13, no default RAID configuration file, so we need to save it manually after the above steps are completed.

# Mdadm - detail --scan --verbose >> / etc / mdadm.conf

Save RAID10 configuration

In this way, we use the method to create over RAID 10, this method is relatively easy. Now, let's use Method 2 to set the RAID 10.

Method 2: Create a RAID 10

1, Tier 2, we must define two sets of RAID 1, then we need to create a good collection of these RAID 1 to define a RAID 0. Here, we will do is create two mirrored (RAID1), and then create the RAID0 (striping).

First, list all can be used to create RAID 10.

# Ls-l / dev | grep sd


It lists four devices

2, 4 disk using fdisk command to partition. How to partition, you can step in accordance with paragraph 1 above.

# Fdisk / dev / sdb
# Fdisk / dev / sdc
# Fdisk / dev / sdd
# Fdisk / dev / sde
3, after the completion of four disk partitions, now check whether there RAID disk blocks.

# Mdadm - examine / dev / sd [b-e]
# Mdadm - examine / dev / sd [b-e] 1

Check the disk 4

Step 1: Create RAID 1

4, first, four disks to create two sets of RAID 1, a group sdb1 'and sdc1', another group is sdd1 'and sde1'.

# Mdadm - create / dev / md1 --metadata = 1.2 - level = 1 - raid-devices = 2 / dev / sd [b-c] 1
# Mdadm - create / dev / md2 --metadata = 1.2 - level = 1 - raid-devices = 2 / dev / sd [d-e] 1
# Cat / proc / mdstat

Create RAID 1

See details RAID 1

Step 2: Create a RAID 0

5. Next, md1 and md2 to create RAID 0.

# Mdadm - create / dev / md0 --level = 0 - raid-devices = 2 / dev / md1 / dev / md2
# Cat / proc / mdstat

Creating a RAID 0

Step 3: Save RAID configuration

6, we need to save the configuration file in /etc/mdadm.conf file, it can be restarted after each load all RAID devices.

# Mdadm - detail --scan --verbose >> / etc / mdadm.conf
After this, we need to follow the method step 31 to create the file system.

That's it! Our approach created over 2 RAID 1 + 0. We will lose half of disk space, but compared to other RAID, its performance will be very good.

in conclusion

Here, we use two methods to create a RAID 10. RAID 10 has good performance and redundancy. I hope this article will help you understand RAID 10 Nested RAID. In the following article we will see how to extend existing RAID arrays, and more exciting content.
     
         
       
         
  More:      
 
- IPTABLES configuration steps under Linux (Linux)
- Linux system font color change (Linux)
- Chrome plug-in management, online-offline installation, part of the plug presentations (Linux)
- Oracle 11g statistics collection - collection of multi-column statistics (Database)
- MD5 and simple to use (Linux)
- Cygwin install Python MySQLdb (Linux)
- SSH configuration under Linux (Linux)
- Spark build standalone version cluster (Server)
- IOS interview questions Summary (Programming)
- Talk about Java EE Learning (Programming)
- BGP routers want to play it by CentOS (Linux)
- Jigsaw project will solve the problem of Java JAR hell Mody (Programming)
- CentOS 6.4 RPM install MySQL-5.6.22-1 (Database)
- The several technical presentation Raid under Linux (Linux)
- To learn from scratch OpenWrt perfect tutorial (Linux)
- Oracle bug Ora-04043 (Database)
- Firewall chapter of Linux server security configuration (Linux)
- Understand ASP.NET 5 running the command: DNVM, DNX, and DNU (Server)
- Redis data types Introduction (Database)
- How to modify the SQL Server auto-increment value and the corresponding solution (Database)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.