第四步 配置文件
echo DEVICE /dev/sd{e,f,g}1 >> /etc/mdadm.conf
mdadm - -detail - -scan >> /etc/mdadm.conf
第五步 穿件文件系统
刚才创建的/dev/md0 现在可以做为一个磁盘设备来使用
#mkfs.ext4 /dev/md0
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=128 blocks, Stripe width=384 blocks
195840 inodes, 782976 blocks
39148 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=805306368
24 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
第六步 挂载磁盘
mkdir /raid0test
mount /dev/md0 /raid0test
第七步 随机启动自挂载磁盘
将mount /dev/md0 /raid0test 命令写入 /dev/rc.local 中
echo mount /dev/md0 /raid0test >>/dev/rc.local
第八步 查看raid 信息
[root@oracle ~]# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sdg1[2] sdf1[1] sde1[0]
3131904 blocks super 1.2 512k chunks
unused devices: [root@oracle ~]# mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Wed Feb 11 14:37:20 2015
Raid Level : raid0
Array Size : 3131904 (2.99 GiB 3.21 GB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent
Update Time : Wed Feb 11 14:37:20 2015
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Chunk Size : 512K
Name : oracle:0 (local to host oracle)
UUID : 2a4adf15:7f218c31:3f5fe32b:d27b7ca9
Events : 0
Number Major Minor RaidDevice State
0 8 65 0 active sync /dev/sde1
1 8 81 1 active sync /dev/sdf1
2 8 97 2 active sync /dev/sdg1
这里使用的是一个mdadm 做的软raid