Environment Virtual Machine + rhel5.1 Add a 1g Virtual Disk (sdb) for the Virtual Machine to experiment with creating 4 partitions (sdb1-4) for the sdb) each partition is 100 Mfdisk/dev/sdbpartprobeRAID create two RAID1mdadm-C/dev/md0-l1-n2/dev/sdb {1, 2}-a for 4 partitions
Environment VM + rhel5.1
Add a 1 GB Virtual Disk (sdb) for testing.
Create 4 partitions (sdb1-4) for sdb each partition is 100 M
Fdisk/dev/sdb
Partprobe
RAID
Create two RAID 1 partitions
Mdadm-C/dev/md0-l 1-n 2/dev/sdb {1, 2}-a yes
Mdadm-C/dev/md1-l 1-n 2/dev/sdb {3, 4}-a yes
-C: Create a raid
-L specify the raid type
-N: number of devices used
View Current RAID Information
Cat/proc/mdstat
Or
Mdadm -- detail/dev/md0
Mdadm -- detail/dev/md1
Format RAID
Mke2fs-j/dev/md0
Mke2fs-j/dev/md1
Test and repair soft RAID
Simulate a drive failure using the mdadm-f parameter
Note: This command is useful in testing RAID1 and RAID5, and RAID0 is unavailable.
Mdadm-f/dev/md0/dev/sdb1
Now let's look at the differences in RADI information.
Cat/proc/mdstat
Delete A broken partition from RAID
Mdadm-r/dev/md0/dev/sdb1