Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Using RAID in Linux: Create a RAID 5     - Java reflection summary (Programming)

- Linux system monitoring, top command of the diagnostic tool Detailed (Linux)

- Installation CD audio file extraction tool Flacon (Linux)

- Digital jQuery scrolling effect (Programming)

- Oracle Client Dedicated and Shared connection mode (Database)

- The FreeBSD zfs: failed with error 6 Error Resolution (Linux)

- Configuring a Linux operating system security management services Explain (Linux)

- ThinkPad X201i installation notes Debian 7.5 (Linux)

- mysqldump MySQL command-line tool (Database)

- OGG-03510 Problem (Database)

- Ubuntu Gitolite management Git Server code base permissions (Server)

- Debian GNU / Linux service list acquisition, shutting down services or run (Linux)

- Zabbix configure DataGuard monitoring (Database)

- Learning and Practice (Linux)

- Use top to monitor the remote server (Server)

- EXP-00091: Exporting questionable statistics Processing Method (Database)

- 17 How to install the Ubuntu 14.04 and Linux Mint Kodi14 (XBMC) (Linux)

- How dependent on Fedora, CentOS, RHEL check RPM packages (Linux)

- Mac OS X command line to submit the local project to Git (Server)

- Zabbix monitoring of the switch (Server)

  Using RAID in Linux: Create a RAID 5
  Add Date : 2018-11-21      
  After RAID 5, data is striped across multiple disks distributed parity stored. Distributed parity striping and parity information means that it will striping data across multiple disks, so there will be good data redundancy.

RAID 5 configuration in Linux

For this RAID level it should be at least three or more disks. RAID 5 is generally used in mass production environments, to spend more of the cost to provide better data redundancy.

What is Parity?

Parity is an error detection in the data storage easiest way common. Parity information is stored on each disk, for example, we have four disks, which is equivalent to a size of the disk space to store all of the disk is divided parity information. If any one disk fails, we can replace the failed disk after to obtain the original data from the parity information reconstruction.

Advantages and disadvantages of RAID 5

Provide better performance.
Support redundancy and fault tolerance.
Supports hot backup.
The parity information storage capacity spent a disk.
A single disk without loss of data after a failure. Reconstruct data from the parity information we can replace the failed disk.
Suitable for transaction-oriented environments, the read operation will be faster.
Because parity footprint, the write operation will be slower.
Reconstruction takes a long time.


Create a RAID 5 requires a minimum of three disks, you can also add more disk, provided you how dedicated hardware RAID controller port. Here, we use "mdadm" package to create a software RAID.

mdadm is a allows us to configure and manage RAID device packages under Linux. No RAID configuration files by default, we have to save the configuration file in a separate file in mdadm.conf after creating and configuring RAID.

Before going any further, I suggest you go to learn the basics of the Linux RAID through the following article.

My server settings

Operating System: CentOS6.5Final
IP Address:
Host Name: rd5.tecmintlocal.com
Disk 1 [20GB]: / dev / sdb
Disk 2 [20GB]: / dev / sdc
Disk 3 [20GB]: / dev / sdd
This is Part 4 of 9 tutorial series, where we use three 20GB on a Linux system or server (named / dev / sdb, / dev / sdc and / dev / sdd) disks with distributed build parity software RAID 5.

Step 1: Install and test disk mdadm

1, as we said earlier, we are using CentOS 6.5 Final version to create a RAID set, but the same also applies to other Linux distributions.

# Lsb_release -a
# Ifconfig | grep inet

CentOS 6.5 Summary

2, if you follow the series to our RAID configuration, we assume that you have installed the "mdadm" package, if not, use the following command according to your Linux distribution installed.

# Yum install mdadm [in RedHat System]
# Apt-get install mdadm [in Debain system]
3, "mdadm" After the package is installed, use the fdisk command to list our first increase in three 20GB hard disk on the system.

# Fdisk -l | grep sd

Install mdadm tool

4. Now check whether there are three RAID disk blocks, use the following command to check.

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

Check Raid Disk

Note: The above picture shows that did not detect any superblock. So, these three disks not defined in the RAID. Let us now begin to create a bar!

Step 2: Create a RAID disk partition

5, first of all, before you create the RAID front disk (/ dev / sdb, / dev / sdc and / dev / sdd) must have a partition, therefore, proceeding to the next to use the fdisk command to partition.

# Fdisk / dev / sdb
# Fdisk / dev / sdc
# Fdisk / dev / sdd
Create / dev / sdb partition

Please create a partition on / dev / sdb hard disk follow the instructions below.

Create a new partition by n.
Then press P to select a primary partition. Select the primary partition is not yet defined because too much area.
Next, select the partition number 1. The default is 1.
Here is a selection cylinder size, we do not need to select the designated size, because we need to use the entire partition RAID, so just press the Enter key twice to assign the entire capacity of the default to it.
Then, press P to print the created partition.
Change the partition type, press L to list all available types.
Press t modify partition type.
As used herein, fd set of RAID types.
Then use p again see our changes.
Use w to save your changes.

Create sdb partition

Note: We still have to follow the steps above to create sdc and sdd partitions.

Create / dev / sdc partition

Now, given the creation method sdc and sdd disk partition by the screenshot below, or you can follow the steps above.

# Fdisk / dev / sdc

Create sdc partition

Create / dev / sdd partition

# Fdisk / dev / sdd

Create Partition sdd

6, create a partition, check the three disks sdb, change sdc, sdd's.

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

Check Disk Changes

Note: In the above image, the type of disk is fd.

7, now in the newly created partition checks RAID block. If it detects no superblock, we can proceed to create a new RAID 5 configuration in these disks.

Check Raid on Partition

* Check in the partition RAID *

Step 3: Create the md devices md0

8, now use all the newly created partition (sdb1, sdc1 and sdd1) to create a RAID device "md0" (ie, / dev / md0), use the following command.

# Mdadm --create / dev / md0 --level = 5 --raid-devices = 3 / dev / sdb1 / dev / sdc1 / dev / sdd1
# Mdadm -C / dev / md0 -l = 5 -n = 3 / dev / sd [b-d] 1 # or
9. After you create a RAID device, check to make sure RAID, from mdstat output can be seen in RAID levels including equipment.

# Cat / proc / mdstat

Verify Raid equipment

If you want to monitor the current creation process, you can use the watch command, cat / proc / mdstat passed to it, it will appear on the screen and are refreshed every 1 second.

# Watch -n1 cat / proc / mdstat

Monitoring RAID 5 build process

Raid 5 Process Summary

10. After you create RAID, use the following command to verify the RAID device

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

Raid level verification

Note: because it shows information for three disks, the output of the command will be a little longer.

11. Next, verify that RAID array, assuming that the device contains a RAID is running and has begun re-synchronization.

# Mdadm --detail / dev / md0

Verify RAID arrays

Step 4: Create a file system md0

12, creates ext4 file system "md0" equipment in front of the mount.

# Mkfs.ext4 / dev / md0

Md0 create a file system

13 Now, created in the / mnt directory raid5, then mount the file system to the / mnt / raid5 / down, and check the file under the mount point, you will see the lost + found directory.

# Mkdir / mnt / raid5
# Mount / dev / md0 / mnt / raid5 /
# Ls -l / mnt / raid5 /
14, create several files at the mount point / mnt / raid5, and add some content in one of the files and then to verify.

# Touch /mnt/raid5/raid5_tecmint_{1..5}
# Ls -l / mnt / raid5 /
# Echo "tecmint raid setups"> / mnt / raid5 / raid5_tecmint_1
# Cat / mnt / raid5 / raid5_tecmint_1
# Cat / proc / mdstat

Mount RAID device

15, we need to add an entry in fstab, otherwise we will not be displayed after system reboot mount point. Edit fstab file to add an entry in the file to chase them down. Mount point vary depending on your environment and different.

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

Automatically mount RAID 5

16. Next, if there are errors running the mount -av command to check fstab entry.

# Mount -av

Error checking Fstab

Step 5: Save the configuration of Raid 5

17, in the previous chapters have already said, there is no default RAID configuration file. We have to manually save. If you do not follow this step does not belong md0 RAID device, it will be some other random number.

Therefore, we must save the configuration before the system is restarted. If the configuration is saved it will be loaded when the system is rebooted into the kernel and then RAID will also be loaded.

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

Save RAID 5 configuration

Note: Save the configuration of the device will remain md0 RAID levels stable.

Step 6: Add a backup disk

18, what is the use spare? It is very useful if we have a spare disk in the array when we any one disk fails, the backup disk will enter the active reconstruction process, and synchronize the data from the other disk, so there is a redundancy.

More on adding spare disks and RAID 5 fault tolerance inspection instructions, read the article below in step 6 and 7.

Add a backup disk In RAID 5
in conclusion

In this article, we have seen how to use three disks to configure a RAID 5. In the next article, we will see how and when troubleshooting a RAID 5 disk how to restore the damage.
- Linux ls command (Linux)
- AIX system file security aspects (Linux)
- Compare Swift achieve rapid sorting and sorted Methods (Programming)
- Ten minutes to find out the character set and character encoding (Linux)
- Ubuntu set Swap Space Tutorial (Linux)
- How to create a binary distribution with Bash (Linux)
- Inject script commands manually annotated summary (Linux)
- Linux System Getting Started Tutorial: How to change the default Java version in Linux (Linux)
- Log device files under Linux - logger (Linux)
- Linux installation notes under GAMIT (Linux)
- Upgrade installation manual CentOS6.5 GCC4.8.2 (Linux)
- Bug tracking library after FastJson omitted the decimal point 0 (Programming)
- OpenStack / Dev stack with neutron on Ubuntu 14.04 (Server)
- Oracle Migration partition table (Database)
- Installation salt-minion on RHEL5 (Linux)
- The user how to install Notepadqq 0.41.0 under ubuntu and debian (Linux)
- Cacti Linux-based system monitoring and alarm (Linux)
- Java study notes: String (Programming)
- Boot automatically remove Linux operating history records (Linux)
- To install Emacs under CentOS 6.5 (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.