RAID 0 | 存取速度最快 没有容错 |
RAID 1 | 完全容错 成本高,硬盘使用率低. |
RAID 3 | 写入性能最好 没有多任务功能 |
RAID 4 | 具备多任务及容错功能 Parity 磁盘驱动器造成性能瓶颈 |
RAID 5 | 具备多任务及容错功能 写入时有overhead |
RAID 0+1 | 速度快、完全容错 成本高 |
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n #按n创建新分区
Command action
e extended
p primary partition (1-4) #输入p 选择创建主分区
p
Partition number (1-4): 1 #输入 1 创建第一个主分区
First cylinder (1-130, default 1): #直接回车,选择分区开始柱面这里就从 1 开始
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-102, default 130):
Using default value 130
Command (m for help): w #然后输入w写盘
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@flyer/]# fdisk -l
Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 130 1044193+ 83 Linux
Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 130 1044193+ 83 Linux
Disk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 130 1044193+ 83 Linux
Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 130 1044193+ 83 Linux
mdadm不采用/etc/mdadm.conf作为主要配置文件,它可以完全不依赖该文件而不会影响阵列的正常工作。
该配置文件的主要作用是方便跟踪软RAID的配置。对该配置文件进行配置是有好处的,但不是必须的。推荐对该文件进行配置。
DEVICE 参与阵列的设备
ARRAY 阵列的描述
通常可以这样来建立:
[root@flyer /]# mdadm --detail --scan >> /etc/mdadm.conf
结果如下:
DEVICE /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
ARRAY /dev/md0 level=raid5 num-devices=4 UUID=8ba81579:e20fb0e8:e040da0e:f0b3fec8
devices=/dev/sdb1,/dev/sdc1,/dev/sdd1,/dev/sde1
/dev/md0:
Version : 00.90.01
Creation Time : Fri Aug 3 13:53:34 2007
Raid Level : raid5
Array Size : 2088192 (2039.25 MiB 2138.31 MB)
Device Size : 1044096 (1019.63 MiB 1069.15 MB)
Raid Devices : 3
Total Devices : 4
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Fri Aug 3 13:54:02 2007
State : clean
Active Devices : 3
Working Devices : 4
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 64K
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sdb1
1 8 17 1 active sync /dev/sdc1
2 8 33 2 active sync /dev/sdd1
3 8 49 -1 spare /dev/sde1
UUID : e62a8ca6:2033f8a1:f333e527:78b0278a
因为找md系统在读入fstab之前,如果找不到md,根本不可能写进fstab里面的
1、mdadm: no such device: /dev/md0:
解决方法:需要重新创建软RAID5阵列
2、mdadm: md device /dev/md0 does not appear to be active.
启动指定的阵列,重新阵列装配到系统中(--assemble)::
[root@flyer ~]# mdadm --assemble --scan /dev/md0 //配置文件错误/dev/mdadm.conf
mdadm: Unknown keyword devices
mdadm: no devices found for /dev/md0
[root@flyer ~]# vi /etc/mdadm.conf
devices /dev/sdb1 /dev/sdc1 /dev/sdd1 //应该是device,这是一个细节,有好多网页教程里是都是devices
ARRAY /dev/md0 level=raid5 num-devices=3 UUID=e62a8ca6:2033f8a1:f333e527:78b0278a
[root@flyer ~]# mdadm -Av /dev/md0 /dev/sd{b,c,d}1 //指定设备启动可以,没有问题
mdadm: looking for devices for /dev/md0
mdadm: /dev/sdb1 is identified as a member of /dev/md0, slot 0.
mdadm: /dev/sdc1 is identified as a member of /dev/md0, slot 1.
mdadm: /dev/sdd1 is identified as a member of /dev/md0, slot 2.
mdadm: added /dev/sdc1 to /dev/md0 as 1
mdadm: added /dev/sdd1 to /dev/md0 as 2
mdadm: added /dev/sdb1 to /dev/md0 as 0
mdadm: /dev/md0 has been started with 3 drives.
解决方法:修改/ect/mdadm.conf文件