How To Set Up A Software RAID-1 On Centos8

Windows Articles

How to install Oracle Java 15 on Ubuntu 20.04 / 18.04?

Hello, friends. We know that Java is one of the most popular programming languages and now it's version 15. So in this...

How to run the Linux Tail command in Windows 10.

Hi! The title of this post may seem incongruous, but it's not. In fact, for some time Microsoft has approached positions with...

How to compress large videos in Windows 10

Hello, how are you? Multimedia resources are definitely used in any system. Indeed, we live in the age of technology. That's why...

How to get Google Opinion Rewards in any Country

Greetings! Google Opinion Rewards is a cool app, which will allow you to earn credit, to spend it on the Google Play...

How to change the hostname on Ubuntu?

This simple tutorial will teach you how to change the hostname on Ubuntu. The steps we will tell you here will work...
Mel Khamlichi
Mel Khamlichihttp://www.osradar.com
Founder of Osradar, from Amsterdam Netherlands

RAID introduces: (Redundant Array of Inexpensive Disks or Drives, or Redundant Array of Independent Disks) is a data storage virtualization technology that combines multiple physical disk drive components into one or more logical units for the purposes of data redundancy, performance improvement, or both. This was in contrast to the previous concept of highly reliable mainframe disk drives referred to as “single large expensive disk” (SLED).

Data is distributed across the drives in one of several ways, referred to as RAID levels, depending on the required level of and performance. The different schemes, or data distribution layouts, are named by the word “RAID” followed by a number, for example, RAID 0 or RAID 1. Each scheme, or RAID level, provides a different balance among the key goals: reliabilityavailabilityperformance, and capacity. RAID levels greater than RAID 0 provide protection against unrecoverable sector read errors, as well as against failures of whole physical drives.——[RAID.wikipedia]

The test environment

  • CentOS 8.0 virtual machine
  • Add two hard disks
  • The installation for mdadm

raid-1 operating steps

  • Use LSBLK to view the current hard disk partition
lsblk
disk partition info

You can see that sdb and sdc are not in use

  • partition for sdb and sdc

Because RAID requires the same size of each hard disk, sdb and sdc are partitioned respectively, and each hard disk is partitioned into a 16G partition, and Hex code is modified as fd

fdisk /dev/sdc
partition for sdc
partition for sdc

Other hard disk partition process omitted, partition after as follows:

disk info
  • installation mdadm
yum install madadm
  • Create a RAID-1

sdb1, sdc1 form a group of raid-1, RAID device named /dev/md0

mdadm -C /dev/md0 -a yes -l 1 -n 2 /dev/sd{c1,b1}
raid-1
build raid-1

Check the progress:

cat /proc.mdstat 
progress

View RAID information:

mdadm -D /dev/md0
RAID information

Here we create a RAID1 disk array from mdadm

  • Create the md0 profile
echo DEVICE /dev/sd{b,c}1 >> /etc/mdadm.conf
mdadm -Evs >> /etc/mdadm.con 
  • Format & create directory and mount
mkfs.xfs /dev/md0
mkdir    /raid1
mount    /dev/md0 /raid1
df       -h
mount disk

At this time we can go to /raid1 directory to store our files

  • Write the partition table and mount automatically at startup
echo "/dev/md0 /raid1 xfs defaults 0 0" >> /etc/fstab 

Conclusion

Save A file to display of RAID 1, RAID will cut into A1, A2, A3, branch of two pieces of written to disk, can make the disk write speed slightly down, because this way is written to disk, one of the hard disk is broken, another have the same backup hard disk, so the RAID 1 is redundant support, but the cost is quite high, also only 1/2 of the disk space can be used

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to install Oracle Java 15 on Ubuntu 20.04 / 18.04?

Hello, friends. We know that Java is one of the most popular programming languages and now it's version 15. So in this...

How to run the Linux Tail command in Windows 10.

Hi! The title of this post may seem incongruous, but it's not. In fact, for some time Microsoft has approached positions with...

How to compress large videos in Windows 10

Hello, how are you? Multimedia resources are definitely used in any system. Indeed, we live in the age of technology. That's why...

How to get Google Opinion Rewards in any Country

Greetings! Google Opinion Rewards is a cool app, which will allow you to earn credit, to spend it on the Google Play...

How to change the hostname on Ubuntu?

This simple tutorial will teach you how to change the hostname on Ubuntu. The steps we will tell you here will work...
x