[[email protected] ~]# mdadm --create --verbose /dev/md0 --level=raid5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd --spare-devices=1 /dev/sde
##########创建RAID
[[email protected] ~]# mdadm -Cv /dev/md0 -l5 -n3 /dev/sdb /dev/sdc /dev/sdd -x1 /dev/sde
##########创建RAID
[[email protected] ~]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sdd[2] sde[3](S) sdc[1] sdb[0]
20971392 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]
unused devices: <none>
[[email protected] ~]#
[[email protected] ~]# mkfs.ext3 /dev/md0
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2621440 inodes, 5242848 blocks
262142 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
160 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[[email protected] ~]# mkdir /mnt/md0
[[email protected] ~]# mount /dev/md0 /mnt/md0
[[email protected] ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
22G 20G 1.3G 94% /
/dev/sda1 99M 13M 82M 14% /boot
tmpfs 3.0G 0 3.0G 0% /dev/shm
/dev/md0 20G 173M 19G 1% /mnt/md0
[[email protected] ~]# cd /mnt/md0
[[email protected] md0]# ls
lost+found
[[email protected] md0]# mdadm -D /dev/md0
/dev/md0:
Version : 0.90
Creation Time : Sat Oct 18 22:17:41 2014
Raid Level : raid5
Array Size : 20971392 (20.00 GiB 21.47 GB)
Used Dev Size : 10485696 (10.00 GiB 10.74 GB)
Raid Devices : 3
Total Devices : 4
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Sun Oct 19 13:25:42 2014
State : clean
Active Devices : 3
Working Devices : 4
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 64K
UUID : af76384d:8f52152b:7cd5b025:24d80ba5
Events : 0.4
Number Major Minor RaidDevice State
0 8 16 0 active sync /dev/sdb
1 8 32 1 active sync /dev/sdc
2 8 48 2 active sync /dev/sdd
3 8 64 - spare /dev/sde