In CentOS4.4, use mdadm to create Raid5 -- Linux Enterprise Application-Linux server application information. The following is a detailed description. I. Environment
1. The operating system is CentOS4.4, And the mdadm software is provided by the system. The version is 1.6.0-3.
2. hda is installed with four hard disks, sda, sdb, sdc, and sdd, which are RAID 5. sdd is hot backup.
2. Preparation
1. First, format the four SCSI hard disks. Input the command fdisk? L. The system displays information about sda, sdb, sdc, and sdd, and prompts that the disk does not contain a valid partition table.
2. [root @ centos/] # fdisk/dev/sda
Command (m for help): n # enter the letter n to add a new partition.
Command action
E extended
P primary partition (1-4)
P # create a primary partition.
Partition number (1-4): 1 # You can create four primary partitions. Enter 1 here to create the first Partition.
First cylinder (1-1044, default 1): # because the hard disk is divided into one partition, press enter by default.
Using default value 1
Last cylinder or + size or + sizeM or + sizeK (1-1044, default 1044 ):
Using default value 1044
Command (m for help): t # change the partition's File System ID.
Selected partition 1
Hex code (type L to list codes): fd # fd Linux raid auto
Changed system type of partition 1 to fd (Linux raid autodetect)
Command (m for help): w # Save and exit
3. Follow the steps above to process four hard disks. Then, run the command fdisk? L check again. We can see that four hard disks have been prepared.
Iii. Configuration
1. Creating raid is very simple. You only need one command.
If a configuration file has been created, run the command mdadm? As/dev/md0
5. About the configuration file
The system contains a configuration file sample/usr/share/doc/mdadm-1.6.0/mdadm. conf-example, refer to create/dev/mdadm. in the conf configuration file, you can also run the command mdadm? Ds to view details, and then use vi to edit and save the text file
To enable the system to automatically mount the raid directory after reboot, You need to modify the/etc/fstab file and add the following line:/dev/md0/mnt/raid ext3 defaults 0 0
Iv. Fault Testing
1. Create a file under/mnt/radi before testing
[Root @ centos raid] # ll/| tee./ls.txt
The mdadm built-in command can mark a hard disk as damaged. For more information, see "Help mdadm -- manage? H.
The sda hard disk is damaged during the fault test.
In the new hard disk access system, correct partitioning should be performed, and it is best to keep the same device number as the previous hard disk replacement. Then execute the command
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.