RAID 0+1原理如上图所示:
操作如下:
先停止md0,md1磁盘:
[root@11g ~]# mdadm -S /dev/md0
mdadm: stopped /dev/md0
[root@11g ~]# mdadm -S /dev/md1
mdadm: stopped /dev/md1
[root@11g ~]# mdadm -S /dev/md2
mdadm: stopped /dev/md2
创建3个md0:
[root@11g ~]# mdadm -C /dev/md3 -l1 -n2 /dev/sd[b,c]1
mdadm: /dev/sdb1 appears to contain an ext2fs file system
size=1048320K mtime=Fri Aug 5 10:08:22 2011
mdadm: /dev/sdb1 appears to be part of a raid array:
level=raid0 devices=2 ctime=Fri Aug 5 09:20:27 2011
mdadm: /dev/sdc1 appears to be part of a raid array:
level=raid0 devices=2 ctime=Fri Aug 5 09:20:27 2011
Continue creating array? y
mdadm: array /dev/md3 started.
[root@11g ~]# mdadm -C /dev/md4 -l1 -n2 /dev/sd[d,e]1
mdadm: array /dev/md4 started.
[root@11g ~]# mdadm -C /dev/md5 -l1 -n2 /dev/sd[f,g]1
mdadm: array /dev/md5 started.
把md3,md4,md5组成一个磁盘阵列:
[root@11g ~]# mdadm -C /dev/md6 -l0 -n3 /dev/md3 /dev/md4 /dev/md5
mdadm: /dev/md3 appears to contain an ext2fs file system
size=1048320K mtime=Fri Aug 5 10:08:22 2011
mdadm: /dev/md4 appears to contain an ext2fs file system
size=208768K mtime=Fri Aug 5 09:53:50 2011
mdadm: /dev/md5 appears to contain an ext2fs file system
size=208768K mtime=Fri Aug 5 10:49:03 2011
Continue creating array? y
mdadm: array /dev/md6 started.
创建成功。
格式化:
[root@11g ~]# mkfs.ext3 /dev/md6
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
即 RAID 0+1 创建完成。
查看磁盘状态信息:
[root@11g ~]# cat /proc/mdstat
Personalities : [raid1] [raid0] [raid6] [raid5] [raid4]
md6 : active raid0 md5[2] md4[1] md3[0]
941504 blocks 64k chunks
md5 : active raid1 sdg1[1] sdf1[0]
208768 blocks [2/2] [UU]
md4 : active raid1 sde1[1] sdd1[0]
208768 blocks [2/2] [UU]
md3 : active raid1 sdc1[1] sdb1[0]
524160 blocks [2/2] [UU]
unused devices: <none>