Data security is one of the most important issues in people's use of computers. Usually, people use hard disk mirroring technology in the server environment to achieve double backup of data. Similarly, in the Linux environment, we can also use this technology.
In the Linux environment, using the Raidtools tool, you can not only mirror two hard disks, but also make soft RAID0, RAID1, and RAID5. It is said to be a soft RAID, because the RAID disk is usually made through a dedicated RAID card. In the Linux environment, the Raidtools software can be used to implement the RAID function, so it is called soft RAID. This article describes several ways to create and use RAID disks based on different Linux distributions.
First, the earlier version of Linux
Download and compile the Raidtools package yourself. The earlier version of the Raidtools package is called md, and has now been officially renamed to Raidtools. Download address: China Free Software Library.
If you have downloaded the Raidtools-0.41.tar.gz package from the Internet, unzip it and compile it yourself. The steps are as follows:
$gunzip -d raidtools-0.41.tar.gz < Br>
$tar -xvf raidtools-0.4.1.tar
Before using Raidtools, first know if the core you are currently using supports md. If the core you are using is 2.0.X and it is not compiled by yourself, in most cases it supports soft RAID. If you are not sure, you should compile the kernel yourself. When configuring, you should choose support for md. After determining the core support RAID being used, compile the Raidtools package as follows:
$cd raidtools-0.41
$./configure
$make
$make install ##make install Generates 4 devices for md0-md3 under /dev.
Click the OK button to complete the installation.
Before using Raidtools, you need to determine the type of RAID to use. Currently, Raidtools can be used as RAID0, RAID1, and RAID5. Since there are only two hard disks and RAID5 cannot be used, in addition to RAID5, you can also choose to use Linear mode or RAID0. I chose to do RAID0. The following is the production process.
1.Create a RAID disk
(1) Shutdown, add two small hard disks to the Slave interface of the first IDE controller and the Slave interface of the second IDE controller. On (the author's CD-ROM on this machine is connected to the master of the second IDE controller).
(2) Power on the system, log in as root, run the following command to partition the hard disk:
#fdisk /dev/hdb
Divide all hard disks into one The primary partition, create a /dev/hdb1 partition.
#fdisk /dev/hdd
Similarly, divide all hard disks into one primary partition and create a /dev/hdd1 partition.
(3) After:
#/sbin/mdcreate raid0 -c4k /dev/md0 /dev/hdb1 /dev/hdd1
Of course, in order to improve access speed, You can divide the hard disk into more detailed partitions and distribute the partitions on different hard disks as much as possible. Then, use Mdcreate to combine them into one mdx (x: 1, 2, 3).
2. Use RAID0 disk
(1) Start the newly created RAID disk:
#/sbin/mdadd -ar
(2) View The contents of the /proc/mdstats file to check the status of RAID0.
#cat /proc/mdstats
System Display:
personalities : [1 linear] [2 raid0]
read-ahead not 8092 sectors < Br>
md0 : active raid0 hdb1 hdd1 xxxx
blocks 8k chunks
md1 : inactive
md2 : inactive
md3 : inactive
This means that the newly created RAID0 is already working properly.
In order to use the new RAID disk, you should also create a new file system on the new disk. The process is as follows:
#mke2fs /dev/md0 ##Note: On a new storage device Create Ext2 file system
Create a new file system, and then mount it to a directory under the root directory, you can use it. The installation method is as follows:
#mount /dev/md0 /opt ##Note: /opt is a Mount point that the author built in the root partition
If necessary, Raidtools can also be used to create RAID5. To improve the reliability of the data.
At present, the server CPU is still divided according to the CPU instruction system, usually divided
Each time the server receives a request, it must be processed by IIS. This is not
Controls how system resources are restored by reclaiming Application Pools settings. The following
Yesterday, a Rewrite rule was configured for the units Ngnix server to prevent im
Apache opens Gzip and Expires to improve page load speed
VPS performance testing tool: UnixBench
What permissions do I need to join the domain?
Configure Nginx subdomain generic resolution binding to a separate directory
Analyze the advantages and disadvantages of network storage categories
Expert trick: How to solve the Linux server hacked?
No monitor, keyboard, how to manage the server?
Three major ways to increase network available bandwidth for virtual machines
Take Apache 2.2 as an example: Mod
Linux under the use of mail to solve
Win8.1 system with IE11 fixed the website to the start screen to achieve a key to open
What should I do if the win10 system font is normal but the third-party software font is blurred?
IIS server application is not available to solve the problem
Windows XP system configuration VPN connection wizard settings tutorial
What should I do if the Windows XP SP3 desktop icon has a background color?
Experience the media center function in win7
How to view the installation path of the download theme package in Windows 8