Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Use mdadm tool to create software RAID 0     - File compression and packaging commands under Linux (Linux)

- Based Docker build stand-alone high-availability cluster Hadoop2.7.1 Spark1.7 (Server)

- Ubuntu 14.04 after the restart the default maximum screen brightness solutions (Linux)

- Nginx DHCP TFTP Kickstart set up automatic installation system (Server)

- Linux iptables: Composition Rules (Linux)

- Valgrind * not * leak check tool (Linux)

- DRBD + Heartbeat solve NFS single point of failure (Server)

- CentOS 6.5 installation VNCServer implement graphical access (Server)

- JavaScript: understanding regular expressions (Programming)

- C ++ inline functions (Programming)

- Use source packages compiled and installed GCC5.1 in Mac OS X 10.10.3 (Linux)

- Generators and iterators in Python (Programming)

- Build Python3.4 + PyQt5.5.1 + Eric6.1.1 development platform under Mac OS X 10.11.1 (Server)

- Graphic Git (Linux)

- Use Ansible efficient delivery Docker container (Server)

- Linux protobuf-c (Linux)

- MySQL time field based partitioning scheme summary (Database)

- Installation on Ubuntu class Winamp audio player Qmmp 0.9.0 (Linux)

- Oracle Database import and export combat (Database)

- tespeed - test speed of Python tools (Linux)

  Use mdadm tool to create software RAID 0
  Add Date : 2018-11-21      
  RAID Redundant Array of Inexpensive Disks namely, high availability and reliability for large-scale environments, as compared to normal use, more data needs to be protected. RAID is a collection of disks, containing a logical array. The drive can be combined together into a single array or called (group) collection.

Create RAID least two shall be used to connect to the RAID controller disks, to form a logical volume, according to the definition of RAID levels to add more drives to an array. Created without using physical hardware RAID is called software RAID. Software RAID is also called the poor RAID.

Creating RAID0 in Linux

The main purpose of using RAID is to save the data in a single point of failure, if we use a single disk to store data, if it is damaged, then there is no chance of getting to our data, in order to prevent loss of data we need a fault-tolerant method. So, we can use multiple disks RAID arrays.

What is in RAID 0 stripe

Strip is divided by the data at the same time on multiple disks. Suppose we have two disks, if we save the data to the logical volume, it saves the data on both disks. Use RAID 0 to achieve better performance, but if a drive fails, we will not get the full data. Therefore, RAID 0 is not a good practice. The only solution is to install RAID 0 logical volumes have the operating system to improve the security of important documents.

RAID 0 high performance.
On RAID 0, zero wasted space.
Zero fault tolerant (if any hard disk fails, the data can not be retrieved).
Write and read performance is very good.

The minimum number of disks to create a RAID 0 allowed is two, but you can add more disks, but the number should be even like 2,4,6,8. If you have a RAID card and has enough physical ports, you can add more disks.

Here, we do not use hardware RAID, this setting requires only software RAID. If we have a physical hardware RAID card, we can access it from its functional interface. Some motherboards default built-in RAID function, you can also use Ctrl + I key to access its interface.

If you are just starting to set RAID, please read our previous article, we have introduced some basic concepts of RAID.

RAID levels and concepts introduced
My server settings

Operating System: CentOS6.5Final
IP Address:
Two disk: 20 GB each
This is Part 2 of 9 tutorial series, in this section, we will look at how to create and use RAID 0 (striping), to name sdb and sdc two 20GB hard disk Case on Linux.

Step 1: Update system and installation of mdadm RAID management software

1, before setting RAID 0 on Linux, we first update about the system, and then install mdadm package. mdadm is a small program that will allow us to configure and manage RAID device under Linux.

# Yum clean all && yum update
# Yum install mdadm -y

Install mdadm tool

Step 2: Make sure the connection of the two 20GB hard drive

2, before creating RAID 0, be sure to confirm the two hard disks can be detected, use the following command to confirm.

# Ls -l / dev | grep sd

Check the hard disk

3, upon detecting a new hard drive, and check whether the drive has been connected to the use of the existing RAID, use the following mdadm command.

# Mdadm --examine / dev / sd [b-c]

Checking the RAID device

From the output above we can see, no RAID using sdb and sdc two drives.

Step 3: Create RAID partition

4. Now create RAID partitions with sdb and sdc, use the fdisk command to create. Here, I'll show you how to create partitions sdb drive.

# Fdisk / dev / sdb
Follow these instructions to create a partition.

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 display the created partition.

Create Partition

Follow these instructions to create a partition for Linux RAID types.

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.
Then use p again see our changes.
Use w to save your changes.

Creating a RAID partition on Linux

Note: Use the steps above to create partitions on the same drive sdc.

5. After you create the partition, verify that both drives are correctly defined RAID, use the following command.

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

Verify RAID partition

Step 4: Create RAID md devices

6, now use the following command to create the md device (ie, / dev / md0), and select the appropriate RAID level.

# Mdadm -C / dev / md0 -l raid0 -n 2 / dev / sd [b-c] 1
# Mdadm --create / dev / md0 --level = stripe --raid-devices = 2 / dev / sd [b-c] 1
-C - Create
-l - Level
-n - RAID device number
7, once the md device has been established, use the following command can view the status of the RAID level, and an array of equipment.

# Cat / proc / mdstat

See RAID Level

# Mdadm -E / dev / sd [b-c] 1

See RAID device

# Mdadm --detail / dev / md0

See RAID arrays

Step 5: RAID device to create a file system

8, will create a RAID device / dev / md0 for the ext4 file system and mounted under / mnt / raid0.

# Mkfs.ext4 / dev / md0

Creating ext4 file system

9. After creating the ext4 file system on the RAID device, now create a mount point (that is, / mnt / raid0), and the device / dev / md0 mount it under.

# Mkdir / mnt / raid0
# Mount / dev / md0 / mnt / raid0 /
10, Next, use the df command to verify that the device / dev / md0 is mounted under / mnt / raid0.

# Df -h
11. Next, under the mount point / mnt / raid0 create a file named tecmint.txt, and add some content files created, and view the contents of files and directories.

# Touch /mnt/raid0/tecmint.txt
# Echo "Hi everyone how you doing?"> /mnt/raid0/tecmint.txt
# Cat /mnt/raid0/tecmint.txt
# Ls -l / mnt / raid0 /

Verify mounted equipment

12, when you verify the mount point, you can add it to / etc / fstab file.

# Vim / etc / fstab
Add the following entries, depending on the location of your installation and use of the file system, making changes on their own.

/ Dev / md0 / mnt / raid0 ext4 deaults 00

Adding devices to the fstab file

13, using the -a mount command to check the fstab entry is wrong.

# Mount -av

Check whether the fstab file is incorrect

Step 6: Save the RAID configuration

14. Finally, save the RAID configuration to a file for future use. Again, we use the mdadm command with the -s (scan) and -v (verbose) option, as shown in FIG.

# Mdadm -E -s -v >> /etc/mdadm.conf
# Mdadm --detail --scan --verbose >> /etc/mdadm.conf
# Cat /etc/mdadm.conf

Save RAID configuration

In this way, we are here to see how to use two hard disk configurations with a striped RAID 0. In the next article, we will see how to set up RAID 5.
- Standard and IO redirection (Linux)
- Oracle Client Easy Connection error ORA-12154, TNS-03505 (Database)
- CentOS 6.5 configuration SSDB 1.8.0 (Server)
- GlusterFS distributed storage deployment (Server)
- To use Java arrays implement the order form (Programming)
- Let CentOS6 yum upgrade to support more source rpm package (Linux)
- Oracle and MySQL difference between the jdbc (Database)
- Android child thread really do not update UI (Programming)
- MongoDB data replication and data slices (Database)
- Under Ubuntu 15.04 installation JDK8 (Linux)
- Android Studio and Git Git configuration file status (Linux)
- JavaScript subarray Deduplication (Programming)
- Oracle create a temporary table space group (Database)
- Parameters of the extra port MySQL 5.6 (Database)
- Linux prohibit non-WHEEL user su command Detail (Linux)
- How to Install Cantata MPD 1.3.3 for Ubuntu and Derived Version Users (Linux)
- Use GLOBK batch command network adjustment (Linux)
- MyCAT log analysis (Database)
- Firewall chapter of Linux server security configuration (Linux)
- Struts2 form of non-use component tags (Programming)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.