Arrays are divided into soft RAID and hard RAID. Soft RAID is implemented by the system based on partitions. Hard RAID is a hard disk operation object, with RAID cards to implement the system environment: RHEL6.3x86 _ 64 This section describes the first step of Soft RAID: partitioning, # fdisk/deb/sdx and change the partition type to support RAID. This is an example of setting up RAID 5. Note: Only each partition in the array has practical significance on different physical hard disks, otherwise
Arrays are divided into soft RAID and hard RAID.
Difference: Soft RAID is implemented by the system based on partitions.
Hard RAID is a hard disk operation object with RAID cards.
System Environment: RHEL6.3 x86_64
Soft RAID is introduced here
Step 1: partition, # fdisk/deb/sdx and change the partition type to support RAID
Taking RAID5 as an example, Note: Only each partition in the array has a practical significance on a different physical hard disk. Otherwise, when several partitions in the array are on the same hard disk, the array does not work when the hard disk is damaged.
Step 2: create, # mdadm-C/dev/md0-a yes-l 5-n 3-x 1/dev/sda3/dev/sdb2/dev/sdc3/dev/sdd2 # use different hard disks create Arrays for different partitions on
Note:-C Indicates Creation
-A yes indicates Automatic Creation
-L 5 indicates creating RAID5
-N 3 indicates the number of devices used.
-X 1 indicates the number of spare devices.
Step 3: format, # mkfs-t ext4-B blocksize-L myriad/dev/md0
Note:-t indicates the System Format
-B indicates the block size. The value is 1024/2048/4096.
-L indicates the volume label
Step 4: Mount, # mkdir/myraid
# Mount/dev/md0/myraid
Arrays are divided into soft RAID and hard RAID.
Difference: Soft RAID is implemented by the system based on partitions.
Hard RAID is a hard disk operation object with RAID cards.
Soft RAID is introduced here
Step 1: partition, # fdisk/deb/sdx and change the partition type to support RAID
Taking RAID5 as an example, Note: Only each partition in the array has a practical significance on a different physical hard disk. Otherwise, when several partitions in the array are on the same hard disk, the array does not work when the hard disk is damaged.
Step 2: create, # mdadm-C/dev/md0-a yes-l 5-n 3-x 1/dev/sda3/dev/sdb2/dev/sdc3/dev/sdd2 # use different hard disks create Arrays for different partitions on
Note:-C Indicates Creation
-A yes indicates Automatic Creation
-L 5 indicates creating RAID5
-N 3 indicates the number of devices used.
-X 1 indicates the number of spare devices.
Step 3: format, # mkfs-t ext4-B blocksize-L myriad/dev/md0
Note:-t indicates the System Format
-B indicates the block size. The value is 1024/2048/4096.
-L indicates the volume label
Step 4: Mount, # mkdir/myraid
# Mount/dev/md0/myraid
Add the following content to the/etc/fstab file:
/Dev/md0/myraid ext4 defaults 0 0 save and exit, so that the restart system can still mount the array.
Note: generate the configuration file: # mdadm -- detail -- scan>/etc/mdadm. the conf operation is to restart the system and the RAID name is still/dev/md0, so that it can be mounted normally. If this operation is not performed, the RAID name will change and the mounting will be faulty.