How To Set Up A Software RAID-1 On Centos8

Windows Articles

How to install SQLite on OpenSUSE 15.2 / 15.1?

There are many good database management systems, but they are not all the same. And the fact that they are not, means...

How to detect port scanning and private IP access with Behave

Hello! Security when surfing the internet is a very serious issue. Consequently, the precautions we take are very important. Moreover, web browsers...

How to install LAMP on OpenSUSE 15.2 / 15.1?

It is increasingly common to find small companies that decide to use the SUSE ecosystem for their servers. It's an unsurprising decision because OpenSUSE...

How to use Mytop on Linux?

We already know that both MySQL and MariaDB are among the most popular database managers out there. They have earned this with...

How to activate the automatic screen saver in Windows 10

Hello! Undoubtedly the time we spend in front of a computer has grown lately. In fact, in these times of pandemic, more...

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 SQLite on OpenSUSE 15.2 / 15.1?

There are many good database management systems, but they are not all the same. And the fact that they are not, means...

How to detect port scanning and private IP access with Behave

Hello! Security when surfing the internet is a very serious issue. Consequently, the precautions we take are very important. Moreover, web browsers...

How to install LAMP on OpenSUSE 15.2 / 15.1?

It is increasingly common to find small companies that decide to use the SUSE ecosystem for their servers. It's an unsurprising decision because OpenSUSE...

How to use Mytop on Linux?

We already know that both MySQL and MariaDB are among the most popular database managers out there. They have earned this with...

How to activate the automatic screen saver in Windows 10

Hello! Undoubtedly the time we spend in front of a computer has grown lately. In fact, in these times of pandemic, more...