In linux, how does one perform soft raid? I hope the following introduction will help and inspire my friends!
Add a 10 Gb hard disk to the Virtual Machine System as sdb, divide the hard disk into five logical disks: sdb {5, 6, 7, 8, 9}, and the size of each disk is 1 GB.
First, use three of the hard drive sdb {5, 6, 7} to create raid5, and sdb8 as the hot backup disk.
Then, take sdb6 out as the faulty disk, then pull out sdb6, and insert the new disk sdb9.
Command: mdadm-C/dev/md0-l5-n3-x1/dev/sdb {5, 6, 7, 8}
The preceding command creates a RAID 5 with 2 GB space. Drive letter:/dev/md0
There are two ways to view the creation result:
1. mdadm -- detail/dev/md0
2. cat/proc/mdstart
The commonly used raid levels include 0, 1, 5, 6, and 10. You only need to modify the value of-l ().
Command for Fault test: mdadm -- manage/dev/md0-f/dev/sdb6-r/dev/sdb6-a/dev/sdb9
-F = -- fail-r = -- remove-a = -- add.
You can mount and edit the fstab file to enable persistent mounting. However, if you delete a created raid, you need to detach it and use
Command: after the raid is stopped by mdadm-S/dev/md0, delete each disk. Where-S = -- stop