: Configure raid 5 (5 drives, three do raid, do two backup)
step:
First, the addition of 5 drives
two, create command with mdadm RAID5
three, and mount a disk array format using
four, simulates the case where the hard disk is damaged
First, add the hard disk 5
Add 5 in the virtual machine hard disk
Second, the use mdadm command to create a RAID5
(1) First check to identify whether the newly added hard disk 5
Sdf can see the already described to recognize the newly added hard disk 5, respectively,
/ dev / sdb, / dev / sdc, / dev / sdd, / dev / sde, / dev / sdf
(2) create a RAID5 using the mdadm command, the name "/ dev / md0"
mdadm -Cv /dev/md0 -n 3 -l 5 -x 2 /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf
(3) the use of format and mount
1) The ext4 formatted as a RAID format:
mkfs.ext4 /dev/md0
2) Create a mount directory
mkdir /RAID5
3) to mount the file system
mount /dev/md0 /RAID5
4) Check the disk mounting information
df -h
5) View / dev / md0 device information
mdadm -D /dev/md0
Fourth, the simulation with a hard disk damage case
It simulates the case where a hard disk is damaged
The -f argument used mdam / dev / sdb array removed
mdadm /dev/md0 -f /dev/sdb
Look state array (/ dev / sdf replace the failed / dev / sdb):
mdadm -D /dev/md0