RAID的实现:
RAID:廉价冗余磁盘阵列,是将几块硬盘变成一个整体使用
后来因为它失去了原有的廉价目的,变得很昂贵,就更名为
独立冗余磁盘阵列
虽然我们无法实现硬件上得RAID因为实力有限,没有买那些设备,但是我们还是能实现RAID的
下面我们就来看一下如何实现软RAID:
第一:软RAID 0的实现:
首先介绍一下RAID 0 的原理,RAID 0是将一股数据流分成两份分别存在两个盘上,以实现提高一倍性能的
现象,不仅如此,它还提供了很大的吞吐量,下面我们就实现一下软RAID 0
第一首先要创建两个分区【当然大于两个也是可以实现raid 0的】,在创建一个大小为2G的RAID时需要
两个大小各为1G的分区,分区创建完之后记得让内核重读一下分区表,
partprobe /dev/sda
[root@server56 raid10]# fdisk /dev/sda
Command (m for help): n
First cylinder (7011-15665, default 7011):
Using default value 7011
Last cylinder or +size or +sizeM or +sizeK (7011-15665, default 15665): +1G
Command (m for help): t
Partition number (1-6): 5
Hex code (type L to list codes): fd
Changed system type of partition 5 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-6): 6
Hex code (type L to list codes): fd
Changed system type of partition 6 to fd (Linux raid autodetect)
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 5235 41945715 8e Linux LVM
/dev/sda3 5236 5300 522112+ 82 Linux swap / Solaris
/dev/sda4 5301 15665 83256862+ 5 Extended
/dev/sda5 5301 5423 987966 fd Linux raid autodetect
/dev/sda6 5424 5546 987966 fd Linux raid autodetect
Linux raid autodetect是建立软RAID 是需要的系统类型一定记得在分区的时候给需要划分的那两个
分区指定成这样的类型,以下是所有可以为其指定的系统类型与系统类型的编号,在指定系统类型的时候
只需要输入前面的编号即可
0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris
1 FAT12 24 NEC DOS 81 Minix / old Lin