RAID5 (five disks, three pieces of RAID, two to back up)

1. Add five more disks to the virtual machine.

share pictures

2.Use themdadm command to create raid5 with the name “/dev/md5”.

-C stands for creation operation, -v shows During the creation process, -a yes to check the RAID name, -n is the number of hard disks used, -l is to define the RAID level and write the name of the hard disk to be added to the array at the end

< p style="text-align: left;">Enter mdadm -Cv /dev/md5 -a yes -n 3 -l 5 /dev/sdb / dev/sdc /dev/sdd /dev/sde/dev/sdf

share picture

span>

3. Format and mount for use

FormatRAID disk array to ext4 format:

input: mkfs.ext4 /dev/md5

share picture

4. Create a mount directory:

input: mkdir /RAID

To mount the file system:

Enter: mount /dev/md5/RAID

View disk mounting information:

< strong>Enter: df -h

Share a picture

5.View/dev/md0 device information

Parameter-D View the detailed information of the RAID array:

Enter: mdadm -D /dev/md5

Share pictures

6.Set up redundant backup disk

If initialized< /span>When a RAID5 array is used, 5 hard disks are directly given, of which 2 hard disk devices are used for automatic replacement when a certain disk in the array fails. First, unmount the disk system: input: umount /dev/md5 strong>

Stop the array device and completely deactivate it: Input: mdadm -S /dev/md5

Now the array has been found Not anymore: input: mdadm -D /dev/md5

share picture

< p style="text-align: left;">

7.Createraid5 and set up two backup failure disks.

Input:mdadm -Cv /dev/md5 -n 3 -l 5 -x 2 /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf

share picture

8.View the detailed information of the array (The number of Spare Devices is 2):

Enter: mdadm -D /dev/md5

Share a picture

9.Format the disk array toext4 system:

Input: mkfs.ext4 /dev/md5

Share a picture

p>

10.Because the fstab file has been set before, it can be mounted directly now:

Enter: mount -a

set the /dev/sdb device to fail and move it out of the array:/dev/sdb strong>

Enter mdadm /dev/md5 -f /dev/sdb

Set the /dev/sdc device to fail and move out of the array:

Enter mdadm /dev/md5 -f /dev/sdc

< span style="font-size: 16px;">Share pictures< /p>

11.Let’s look at the detailed information of the array again (the hard disk sde is directly replaced at this time):< /p>

Enter: mdadm -D /dev/md5

share picture< /strong>

Leave a Comment

Your email address will not be published.