The first step:
First, add the same disk on the CentOS virtual machine setup in VMware, with a number greater than 3. This is the condition of doing RAID5.
Add a hard drive, handle the rest of the full tube outside the capacity to ensure the same drive configuration. To make sure it's good, I'll give you:
The next step is to determine and then generate multiple hard disks.
Step Two:
If you open the virtual machine for operation, please reboot the virtual machine, the system may not be refreshed, can not see the disk.
View disk after re-entering virtual machine:fdisk-l
You can see information on multiple disks, such as:
This is where the hard drive has been created. The next step is to familiarize yourself with the following MDADM instructions:
The Mdadm program is a standalone program that can perform all of the software RAID management functions, mainly with 7 modes of usage:
Pattern Name Key Features
Create use an idle device to create a new array, with each device having a metadata block.
Assemble assemble each block device that originally belonged to an array as an array.
Build Create or assemble arrays that do not require metadata, and each device has no meta-data blocks
Manage manage devices that have already stored the array, such as adding a hot spare disk or setting a disk to fail, and then removing the disk from the array.
Misc report or modify information about devices in the array, such as querying arrays or device status information
Growchange the capacity or number of devices in the array used by each device in the array
Monitor monitors one or more arrays to escalate the specified event.
Take note of the first letter capitalized when executing. Not all of them are:
You can learn from the following links:
http://blog.csdn.net/yuesichiu/article/details/8502680
http://blog.csdn.net/liumang_d/article/details/4325013
The next step is to start RAID5.
Perform:
Be careful not to use the disk that is currently in use, here SDA may be the system is using the disk, will error, SDA is busy.
Then execute mdadm-d/dev/md127 to view the disks that were created. Here the number of the MD back is to see the number you generate, not deterministic. (Here for spare after the building, but after RAID5 here active devices and working devices are 5 other for 0, I do not use failed disk here)
After this, you can view:/proc/mdstat
You can see disk-related information here
Step Three:
Then reapply for a disk, to change the raid environment to do a spare. Is the hot spare disk. Here to pay attention to see which disk did not write to RAID5, I was wrong, tangled for a long time.
By adding the spare disk as follows:
The system appeared spare devices device.
Fourth Step:
The next step is to move the spare device to raid: Check the information first.
Then execute the command:
This allows the spare to be converted into a RAID disk.
CentOS Soft raid5+ hot standby under VMware environment