RAID functionality with software under Linux operating systems

Source: Internet
Author: User
Tags versions

Data security is one of the most important problems people use in computers. Typically, a hard disk mirroring technique is used in a server environment to achieve a dual backup of the data. Also, we can use this technology in a Linux environment.

In the Linux environment, the use of raidtools tools, not only can be two hard disk mirroring, but also can make soft RAID0, RAID1, RAID5. Said to be soft raid, because the raid disk is usually done through a dedicated RAID card, and in a Linux environment, the Raidtools software can be used to implement RAID functions, so called soft raid. This article describes several ways to build and use a RAID disk based on different versions of Linux.

First, earlier versions of Linux

Download and compile the Raidtools software package, the earlier version of the Raidtools package named MD, has now been officially renamed Raidtools. Download address: China free Software Library. If you have downloaded the RAIDTOOLS-0.41.TAR.GZ software package from the Internet, unzip it and compile it yourself as follows:

$gunzip -d raidtools-0.41.tar.gz
$tar -xvf raidtools-0.4.1.tar

Before using Raidtools, it is important to know whether the core currently in use supports MD. If you're using 2.0.X at the core, and you're not compiling it yourself, in most cases, soft raid is supported. If you are unsure, you should compile the core yourself. When configured, you should select support for Md. After determining which core support raid is being used, compile the Raidtools package as follows:

$cd raidtools-0.41
$./configure
$make
$make install ##make install在/dev下产生md0-md3共4个设备。

Click the OK button to complete the installation.

Before using Raidtools, you also need to determine the kind of raid you want to use. At present, the use of raidtools can be used as RAID0, RAID1 and RAID5. Because there are only two hard drives to use RAID5, in addition to RAID5, you can also choose Linear mode or RAID0. The author chooses to make RAID0. The following is the production process.

1. Set up RAID disk

(1) Shutdown, two small hard drives are added to the slave interface of the first IDE controller and the Slave interface of the second IDE controller (the CD-ROM on this machine is connected to master of the second IDE controller).

(2) Power on the boot system, log in as root, run the following command to partition the hard disk:

#fdisk /dev/hdb

Divide all the hard drives into a primary partition, build ⒁ Huan DEV/HDB1 partition.

#fdisk /dev/hdd

Again, divide all the hard drives into one primary partition, after establishing a/DEV/HDD1 partition:

#/sbin/mdcreate raid0 -c4k /dev/md0 /dev/hdb1 /dev/hdd1

Of course, in order to improve the speed of access, you can make the hard disk more detailed division, as far as possible to distribute the partition in a reasonable location on different hard drives. Then, use Mdcreate to combine them into an MDX (x:1,2,3).

2. Use RAID0 disk

(1) Launch the newly created RAID disk:

#/sbin/mdadd -ar

(2) View the contents of the/proc/mdstats file to check the status of the RAID0.

#cat /proc/mdstats

System display:

personalities : [1 linear] [2 raid0]
read—ahead not 8092 sectors
md0 : active raid0 hdb1 hdd1 xxxx
blocks 8k chunks
md1 : inactive
md2 : inactive
md3 : inactive

This means that the new RAID0 is already working.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.