Liunx软Raid实现

                              Liunx软Raid实现

                                                    作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

  在配置软Raid之前,我们首先要了解一下什么是Raid,Raid又分哪几个系列?哪个又是最靠谱的组合?我们生产环境中有必要用Raid吗?各个级别的Raid适合什么样的生产场景等等,带着这一些列的问题,让我们一起先了解一下Raid.

 1 #!/usr/bin/env python
 2 #_*_coding:utf-8_*_
 3 #@author :yinzhengjie
 4 #blog:http://www.cnblogs.com/yinzhengjie/tag/python%E8%87%AA%E5%8A%A8%E5%8C%96%E8%BF%90%E7%BB%B4%E4%B9%8B%E8%B7%AF/
 5 #EMAIL:[email protected]
 6
 7 ‘‘‘
 8 仅用于标识磁盘组合方式的不同
 9
10 Raid0:
11 工作原理:
12     Raid0是所有raid中存储性能最强的阵列形式。其工作原理就是在多个磁盘上分散存取连续的数据,这样,当需要存取数据是多个磁盘可以并排执行,每个磁盘执行属于它自己的那部分数据请求,显著提高磁盘整体存取性能。
13 适用场景:
14     至少需要两块磁盘,没有容错能力,读写性能都提示,  磁盘空间利用率提升了100%,两块磁盘型号最好要一样,一般存放swap,或者/tmp目录的,适用于低成本、低可靠性的台式系统。
15
16 Raid1:
17 工作原理:
18     又称镜像盘,把一个磁盘的数据镜像到另一个磁盘上,采用镜像容错来提高可靠性,具有raid中最高的数据冗余能力。存数据时会将数据同时写入镜像盘内,读取数据则只从工作盘读出。发生故障时,系统将从镜像盘读取数据,然后再恢复工作盘正确数据。这种阵列方式可靠性极高,但是其容量会减去一半。
19 适用场景:
20     至少需要两块磁盘,镜像,具有硬件容错能力,读性能提升,写性能下降,磁盘空间利用率只有50%。广泛用于数据要求极严的应用场合,如商业金融、档案管理等领域。只允许一颗硬盘出故障。要注意的是,具有硬件容错能力 != 你可以对数据不进行备份。
21     因此对重要数据的备份一定要做好。
22
23 Raid4:
24 工作原理:
25     至少需要三块磁盘,两块盘存数据,一块盘单独用来存另外两块磁盘的校验值。读写性能有所提升,读写性能(n-1)/n。而Raid5是缺吧数据和校验值打乱,分别存到3快磁盘上去。详情可以参考Raid5介绍。Raid生产环境很少人用。
26
27 Raid5:
28 工作原理:
29     Raid5可以看成是Raid0+1的低成本方案。采用循环偶校验独立存取的阵列方式。将数据和相对应的奇偶校验信息分布存储到组成RAID5的各个磁盘上。当其中一个磁盘数据发生损坏后,利用剩下的磁盘和相应的奇偶校验信息 重新恢复/生成丢失的数据而不影响数据的可用性。
30 适用场景:
31     至少需要3个或以上的硬盘。适用于大数据量的操作。成本稍高、储存新强、可靠性强的阵列方式。适合用来安装操作系统。
32
33 Raid6:
34 工作原理:
35     其实他就是在Raid5上做的一个优化,存储机制和Raid5类似,只不过多了一块磁盘做热备,当其中一块磁盘坏掉时,另外一块磁盘立即补位,完成存储功能。
36 适用场景:
37     至少需要四块磁盘,允许两块盘出错,读写性能提升,磁盘利用率(n-2)/n
38
39 Raid10:
40 工作原理:
41     其实就是Raid1+Raid0的组合,至少需要四块磁盘,允许不同组内各坏一块磁盘,读写性能提升,磁盘使用率50%。
42 使用场景:
43     如果有重要数据的话,建议用这种模式,该模式是就有冗余能力的。不建议用Raid5或者Raid01来存取重要的数据,因为Raid5不靠谱,当一块磁盘坏掉的话,工作性能变得特别差!如果在坏一块的话就彻底不能工作了。
44
45 Raid01:
46     将Raid0和Raid1技术结合在一起,兼顾两者的优势。在数据得到保障的同时,还能提供较强的存储性能。不过至少要求4个或以上的硬盘,也只运行一个磁盘出错。是一种高成本、高可靠性、高存储性能的三高阵列技术。
47
48
49 后记:
50     软Raid没有硬Raid性能好,不建议使用,因为软Raid是操作系统提供的一个MD模块来实现的,如果用软Raid去存取数据,对CPU消耗也是很大的,会降低服务器性能。虽然比不上硬Raid,但是有总比没有好,做了软Raid就是比不做Raid要强这是没话说的。
51     软Raid只能识别的文件系统表示是:FD,因此我们在配置的时候一定要注意。
52
53 ‘‘‘

  通过以上的知识点,我们了解到了Raid比较常见的几个级别,我以上还没有介绍完呢,还有很多类型。但是这不是重点,即使有我告诉你我也不会配置,我就会配置常见的几款Raid级别,一会我会一一揭晓的,在配置之前,我们需要做一个准备工作,比如,我们配置一个创建一个大小为6G的RAID0,根据其原理,我们可以创建2个分区,而且2个分区空间大小一样。好,让我们一起来做一下准备工作。

  1 #!/usr/bin/env python
  2 #_*_coding:utf-8_*_
  3 #@author :yinzhengjie
  4 #blog:http://www.cnblogs.com/yinzhengjie/tag/python%E8%87%AA%E5%8A%A8%E5%8C%96%E8%BF%90%E7%BB%B4%E4%B9%8B%E8%B7%AF/
  5 #EMAIL:[email protected]
  6
  7 ‘‘‘
  8 [[email protected] ~]# fdisk /dev/sdb  #对sdb这块新硬盘进行分区
  9 Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
 10 Building a new DOS disklabel with disk identifier 0xc9f2a383.
 11 Changes will remain in memory only, until you decide to write them.
 12 After that, of course, the previous content won‘t be recoverable.
 13
 14 Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
 15
 16 WARNING: DOS-compatible mode is deprecated. It‘s strongly recommended to
 17          switch off the mode (command ‘c‘) and change display units to
 18          sectors (command ‘u‘).
 19
 20 Command (m for help): p  #查看分区信息
 21
 22 Disk /dev/sdb: 21.5 GB, 21474836480 bytes
 23 255 heads, 63 sectors/track, 2610 cylinders
 24 Units = cylinders of 16065 * 512 = 8225280 bytes
 25 Sector size (logical/physical): 512 bytes / 512 bytes
 26 I/O size (minimum/optimal): 512 bytes / 512 bytes
 27 Disk identifier: 0xc9f2a383
 28
 29    Device Boot      Start         End      Blocks   Id  System
 30
 31 Command (m for help): n  #创建一个新的分区
 32 Command action
 33    e   extended
 34    p   primary partition (1-4)
 35 p  #指定分区类型为主分区
 36 Partition number (1-4): 1  #定义编号
 37 First cylinder (1-2610, default 1):  #指定其实位置,如果不指定,默认从1开始分配。
 38 Using default value 1
 39 Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): +3G   #指定结束位置为3G,因此这里是创建一个3G大小的分区
 40
 41 Command (m for help): N  #新建一个分区
 42 Command action
 43    e   extended
 44    p   primary partition (1-4)
 45 P  #配置其模式为主分区
 46 Partition number (1-4): 2  #设置编号为2
 47 First cylinder (394-2610, default 394):
 48 Using default value 394
 49 Last cylinder, +cylinders or +size{K,M,G} (394-2610, default 2610): +3G
 50
 51 Command (m for help): w  #保存以上的配置
 52 The partition table has been altered!
 53
 54 Calling ioctl() to re-read partition table.
 55 Syncing disks.
 56 [[email protected] ~]# cat /proc/partitions  #查看分区信息,由于我这是款新硬盘,可以不用重读分区表系统就能自动识别出来。
 57 major minor  #blocks  name
 58
 59    8       16   20971520 sdb
 60    8       17    3156741 sdb1
 61    8       18    3156772 sdb2
 62    8        0   20971520 sda
 63    8        1     307200 sda1
 64    8        2   18631680 sda2
 65    8        3    2031616 sda3
 66    8       32   20971520 sdc
 67 [[email protected] ~]# fdisk  /dev/sdb  #由于我们需要做Raid,因此我们需要对分区做修改,即修改分区的类型
 68
 69 WARNING: DOS-compatible mode is deprecated. It‘s strongly recommended to
 70          switch off the mode (command ‘c‘) and change display units to
 71          sectors (command ‘u‘).
 72
 73 Command (m for help): p  #查看当前分区情况,请注意其ID信息
 74
 75 Disk /dev/sdb: 21.5 GB, 21474836480 bytes
 76 255 heads, 63 sectors/track, 2610 cylinders
 77 Units = cylinders of 16065 * 512 = 8225280 bytes
 78 Sector size (logical/physical): 512 bytes / 512 bytes
 79 I/O size (minimum/optimal): 512 bytes / 512 bytes
 80 Disk identifier: 0xc9f2a383
 81
 82    Device Boot      Start         End      Blocks   Id  System
 83 /dev/sdb1               1         393     3156741   83  Linux
 84 /dev/sdb2             394         786     3156772+  83  Linux
 85
 86 Command (m for help): t  #修改ID
 87 Partition number (1-4): 1  #选择分区标号
 88 Hex code (type L to list codes): fd  #指定RAID可以识别的分区类型
 89 Changed system type of partition 1 to fd (Linux raid autodetect)
 90
 91 Command (m for help): t  #原理同上
 92 Partition number (1-4): 2
 93 Hex code (type L to list codes): fd
 94 Changed system type of partition 2 to fd (Linux raid autodetect)
 95
 96 Command (m for help): p  #注意观察IP情况和System的变化
 97
 98 Disk /dev/sdb: 21.5 GB, 21474836480 bytes
 99 255 heads, 63 sectors/track, 2610 cylinders
100 Units = cylinders of 16065 * 512 = 8225280 bytes
101 Sector size (logical/physical): 512 bytes / 512 bytes
102 I/O size (minimum/optimal): 512 bytes / 512 bytes
103 Disk identifier: 0xc9f2a383
104
105    Device Boot      Start         End      Blocks   Id  System
106 /dev/sdb1               1         393     3156741   fd  Linux raid autodetect
107 /dev/sdb2             394         786     3156772+  fd  Linux raid autodetect
108
109 Command (m for help): w  #保存当前配置
110 The partition table has been altered!
111
112 Calling ioctl() to re-read partition table.
113 Syncing disks.
114 [[email protected] ~]#
115
116 ‘‘‘

  做好了准备环境之后,配置起来就简单的多了,其实只需要一条命令就搞定了,我们如果配置呢?请往下看:

 1 #!/usr/bin/env python
 2 #_*_coding:utf-8_*_
 3 #@author :yinzhengjie
 4 #blog:http://www.cnblogs.com/yinzhengjie/tag/python%E8%87%AA%E5%8A%A8%E5%8C%96%E8%BF%90%E7%BB%B4%E4%B9%8B%E8%B7%AF/
 5 #EMAIL:[email protected]
 6
 7 ‘‘‘
 8 [[email protected] ~]# mdadm -C /dev/md0 -a yes -l 0 -n 2 /dev/sdb{1,2}  #创建一个RAID0
 9 mdadm: Defaulting to version 1.2 metadata
10 mdadm: array /dev/md0 started.
11 [[email protected] ~]# cat /proc/mdstat   #查看RAID信息
12 Personalities : [raid0] #提示属性是RAID0
13 md0 : active raid0 sdb2[1] sdb1[0]  #该状态为活跃状态,后面跟了2个设备名称,其实就是我们刚刚分的2个分区。
14       6308864 blocks super 1.2 512k chunks
15
16 unused devices: <none>
17 [[email protected] ~]#
18 [[email protected] ~]# mdadm -D /dev/md0 #从上面我们看到了有个"md0"的标记,我们可以看它的具体详细信息系,当然这个-D就等价于--detail参数,下面我也有演示
19 /dev/md0:
20         Version : 1.2
21   Creation Time : Mon May 15 05:56:32 2017
22      Raid Level : raid0  #显示RAID的级别
23      Array Size : 6308864 (6.02 GiB 6.46 GB)  #显示RAID的磁盘大小
24    Raid Devices : 2  #表示当前RAID级别有几块设备
25   Total Devices : 2  #表示总数的设备
26     Persistence : Superblock is persistent
27
28     Update Time : Mon May 15 05:56:32 2017  #更新时间
29           State : clean
30  Active Devices : 2  #活动状态的
31 Working Devices : 2  #处于工作状态的,如果这个数字不正常的话,那么你的RAID就真的出现问题了,因为我们知道RAID0是没有冗余效果的。
32  Failed Devices : 0
33   Spare Devices : 0
34
35      Chunk Size : 512K
36
37            Name : yinzhengjie:0  (local to host yinzhengjie)
38            UUID : 0fe39292:6216e860:6f92259a:38b22186
39          Events : 0
40
41     Number   Major   Minor   RaidDevice State
42        0       8       17        0      active sync   /dev/sdb1
43        1       8       18        1      active sync   /dev/sdb2
44 [[email protected] ~]# mdadm --detail /dev/md0
45 /dev/md0:
46         Version : 1.2
47   Creation Time : Mon May 15 05:56:32 2017
48      Raid Level : raid0
49      Array Size : 6308864 (6.02 GiB 6.46 GB)
50    Raid Devices : 2
51   Total Devices : 2
52     Persistence : Superblock is persistent
53
54     Update Time : Mon May 15 05:56:32 2017
55           State : clean
56  Active Devices : 2
57 Working Devices : 2
58  Failed Devices : 0
59   Spare Devices : 0
60
61      Chunk Size : 512K
62
63            Name : yinzhengjie:0  (local to host yinzhengjie)
64            UUID : 0fe39292:6216e860:6f92259a:38b22186
65          Events : 0
66
67     Number   Major   Minor   RaidDevice State
68        0       8       17        0      active sync   /dev/sdb1
69        1       8       18        1      active sync   /dev/sdb2
70 [[email protected] ~]#
71
72 ‘‘‘

  好了,上面是配置RAID0的全过程,那么配置RAID1又是如何做到的呢?其实so easy,用法几乎一致,首先你得配置好环境,假如我们创建一个18G的RAID1我们应该如何做呢?

  1 #!/usr/bin/env python
  2 #_*_coding:utf-8_*_
  3 #@author :yinzhengjie
  4 #blog:http://www.cnblogs.com/yinzhengjie/tag/python%E8%87%AA%E5%8A%A8%E5%8C%96%E8%BF%90%E7%BB%B4%E4%B9%8B%E8%B7%AF/
  5 #EMAIL:[email protected]
  6
  7 ‘‘‘
  8
  9 [[email protected] ~]# fdisk /dev/sdc #对新设备进行分区
 10 Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
 11 Building a new DOS disklabel with disk identifier 0x7edec25e.
 12 Changes will remain in memory only, until you decide to write them.
 13 After that, of course, the previous content won‘t be recoverable.
 14
 15 Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
 16
 17 WARNING: DOS-compatible mode is deprecated. It‘s strongly recommended to
 18          switch off the mode (command ‘c‘) and change display units to
 19          sectors (command ‘u‘).
 20
 21 Command (m for help): P #查看当前分区情况
 22
 23 Disk /dev/sdc: 21.5 GB, 21474836480 bytes
 24 255 heads, 63 sectors/track, 2610 cylinders
 25 Units = cylinders of 16065 * 512 = 8225280 bytes
 26 Sector size (logical/physical): 512 bytes / 512 bytes
 27 I/O size (minimum/optimal): 512 bytes / 512 bytes
 28 Disk identifier: 0x7edec25e
 29
 30    Device Boot      Start         End      Blocks   Id  System
 31
 32 Command (m for help): N #创建一个新的分区
 33 Command action
 34    e   extended
 35    p   primary partition (1-4)
 36 P
 37 Partition number (1-4): 1
 38 First cylinder (1-2610, default 1):
 39 Using default value 1
 40 Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): +9G
 41
 42 Command (m for help): N  #在此创建一个新的分区
 43 Command action
 44    e   extended
 45    p   primary partition (1-4)
 46 P
 47 Partition number (1-4): 2
 48 First cylinder (1177-2610, default 1177):
 49 Using default value 1177
 50 Last cylinder, +cylinders or +size{K,M,G} (1177-2610, default 2610): +9G
 51
 52 Command (m for help): P  #创建完毕后,看一下您创建的是否正确
 53
 54 Disk /dev/sdc: 21.5 GB, 21474836480 bytes
 55 255 heads, 63 sectors/track, 2610 cylinders
 56 Units = cylinders of 16065 * 512 = 8225280 bytes
 57 Sector size (logical/physical): 512 bytes / 512 bytes
 58 I/O size (minimum/optimal): 512 bytes / 512 bytes
 59 Disk identifier: 0x7edec25e
 60
 61    Device Boot      Start         End      Blocks   Id  System
 62 /dev/sdc1               1        1176     9446188+  83  Linux
 63 /dev/sdc2            1177        2352     9446220   83  Linux
 64 Command (m for help): t  #修改一下分区类型为FD
 65 Partition number (1-4): 1
 66 Hex code (type L to list codes): fd
 67 Changed system type of partition 1 to fd (Linux raid autodetect)
 68
 69 Command (m for help): t
 70 Partition number (1-4): 2
 71 Hex code (type L to list codes): fd
 72 Changed system type of partition 2 to fd (Linux raid autodetect)
 73
 74 Command (m for help): p  #修改完毕后请确认是否为FD,如果这里不是FD,做RAID会报错的。
 75
 76 Disk /dev/sdc: 21.5 GB, 21474836480 bytes
 77 255 heads, 63 sectors/track, 2610 cylinders
 78 Units = cylinders of 16065 * 512 = 8225280 bytes
 79 Sector size (logical/physical): 512 bytes / 512 bytes
 80 I/O size (minimum/optimal): 512 bytes / 512 bytes
 81 Disk identifier: 0x7edec25e
 82
 83    Device Boot      Start         End      Blocks   Id  System
 84 /dev/sdc1               1        1176     9446188+  fd  Linux raid autodetect
 85 /dev/sdc2            1177        2352     9446220   fd  Linux raid autodetect
 86
 87 Command (m for help): w  #保存当前配置。
 88 The partition table has been altered!
 89
 90 Calling ioctl() to re-read partition table.
 91 Syncing disks.
 92 [[email protected] ~]#
 93 [[email protected] ~]# cat /proc/partitions  #验证一下系统是否识别分区,如果没有识别用partx -a参数进行一下重读分区表即可,这里我用的是新磁盘实验,就不必了。
 94 major minor  #blocks  name
 95
 96    8       16   20971520 sdb
 97    8       17    3156741 sdb1
 98    8       18    3156772 sdb2
 99    8        0   20971520 sda
100    8        1     307200 sda1
101    8        2   18631680 sda2
102    8        3    2031616 sda3
103    8       32   20971520 sdc
104    8       33    9446188 sdc1  #看到了自己的分区。
105    8       34    9446220 sdc2
106    9        0    6308864 md0
107 [[email protected] ~]#
108
109
110 ‘‘‘

在/dev/sdb上配置好2个分区

  做好以上的配置环境之后,其实配置起来就很简单的,几乎和上面配置事一模一样的。

 1 #!/usr/bin/env python
 2 #_*_coding:utf-8_*_
 3 #@author :yinzhengjie
 4 #blog:http://www.cnblogs.com/yinzhengjie/tag/python%E8%87%AA%E5%8A%A8%E5%8C%96%E8%BF%90%E7%BB%B4%E4%B9%8B%E8%B7%AF/
 5 #EMAIL:[email protected]
 6
 7 ‘‘‘
 8 [[email protected] ~]# mdadm -C /dev/md1 -a yes -l 1 -n 2 /dev/sdc{1,2}  #创建RAID1
 9 mdadm: Note: this array has metadata at the start and
10     may not be suitable as a boot device.  If you plan to
11     store ‘/boot‘ on this device please ensure that
12     your boot-loader understands md/v1.x metadata, or use
13     --metadata=0.90
14 Continue creating array? yes  #这个消息忽略即可,输入yes
15 mdadm: Defaulting to version 1.2 metadata
16 mdadm: array /dev/md1 started.
17 [[email protected] ~]#
18 [[email protected] ~]# cat /proc/mdstat  #在此查看RAID信息
19 Personalities : [raid0] [raid1]
20 md1 : active raid1 sdc2[1] sdc1[0]
21       9437952 blocks super 1.2 [2/2] [UU]
22       [====>................]  resync = 23.3% (2200064/9437952) finish=0.5min speed=220006K/sec  #我们发现RAID1正在把2个分区制作成镜像的过程,目前已经完成了23.3%,我们可以过段时间在来查看,也可以用watch命令实时查看进度情况。
23
24 md0 : active raid0 sdb2[1] sdb1[0]
25       6308864 blocks super 1.2 512k chunks
26
27 unused devices: <none>
28 [[email protected] ~]#
29 [[email protected] ~]# watch -n 1  ‘cat /proc/mdstat‘  #我们也可以通过监控命令实时查看进度
30 Every 1.0s: cat /proc/mdstat                                             Mon May 15 06:23:40 2017
31
32 Personalities : [raid0] [raid1]
33 md1 : active raid1 sdc2[1] sdc1[0]
34       9437952 blocks super 1.2 [2/2] [UU]
35
36 md0 : active raid0 sdb2[1] sdb1[0]
37       6308864 blocks super 1.2 512k chunks
38
39 unused devices: <none>
40 [[email protected] ~]#
41 [[email protected] ~]# mdadm -D /dev/md1 #查看RAID1的信息
42 /dev/md1:
43         Version : 1.2
44   Creation Time : Mon May 15 06:19:24 2017
45      Raid Level : raid1
46      Array Size : 9437952 (9.00 GiB 9.66 GB)
47   Used Dev Size : 9437952 (9.00 GiB 9.66 GB)
48    Raid Devices : 2
49   Total Devices : 2
50     Persistence : Superblock is persistent
51
52     Update Time : Mon May 15 06:20:11 2017
53           State : clean
54  Active Devices : 2
55 Working Devices : 2
56  Failed Devices : 0
57   Spare Devices : 0
58
59            Name : yinzhengjie:1  (local to host yinzhengjie)
60            UUID : cc10bfb8:cef2b77a:6a72b4b6:8c58484b
61          Events : 17
62
63     Number   Major   Minor   RaidDevice State
64        0       8       33        0      active sync   /dev/sdc1
65        1       8       34        1      active sync   /dev/sdc2
66 [[email protected] ~]#
67 ‘‘‘

  

时间: 2024-08-05 15:45:06

Liunx软Raid实现的相关文章

raid基础及linux软raid之dmadm

RAID  0 : 条带         性能提升:读,写  n         冗余能力(容错能力):无         空间利用率: nS         至少2块磁盘    1 : 镜像         性能提升:写性能有所下降,读性能提升         冗余能力:有         空间利用率: 1/2         至少2块磁盘  2 :   3 :   4 :   5 :          性能表现:读写提升         冗余能力:有         空间利用率:(n-1)/

Redhat6.4 软raid磁盘更换

Redhat6.4 软raid磁盘更换 由下图可知/dev/md10的raid级别为10,raid成员为4块硬盘,正在工作的却只有3块,其中一块故障丢失. 添加一块新硬盘,创建分区为fd(Linux raid autodetect)模式 添加新硬盘为故障阵列raid10的热备 热备盘添加成功后会自动顶替raid10中故障硬盘位置,自动Rebuild同步,等待同步完成. Rebuild完成,状态正常. 注:若系统创建/etc/mdadm.conf开机自动挂载软raid文件,需将此文件中故障盘符更改

linux自学笔记——RAID级别特性以及软RAID的实现

RAID,Redundant Arrays of Inexpensive Disks 廉价冗余磁盘阵列,又称为Redundant Arrays of Independent Disks,独立冗余磁盘阵列. 其基本原理就是利用多块较小的磁盘通过不同的组织方式,组成一个大的磁盘组,以提高磁盘的IO能力和耐用性.由于组织方式不同,所以把RAID分为多个级别.而最常用的是RAID0,RAID1,RAID5,RAID6,RAID10,RAID01.下面我们将对以上的级别进行比较分析. 级别:level R

磁盘管理之软RAID

1.RAID概述 RAID,Redundant Arrays of Inexpensive(Independent)Disks的简称,独立磁盘冗余阵列,简称磁盘阵列.简单来说,RAID是把多个硬盘组合成为一个逻辑扇区,因此,操作系统只会把它当作一个硬盘,经常被用在服务器电脑上.不同的RAID实现的功能也是不尽相同的,或增强处理速度,或增强容错能力,当然,更有甚者,是可以兼备这个特性的. 2.RAID分类 <1>RAID0 <2>RAID1 <3>RAID4 <4&

常见RAID级别原理, Linux中软RAID实现方式详解

前言:本文章耗费作者大量时间,转载声明转自anyisalin.blog.51cto.com RAID简介 RAID(Redundant Arry of Independent Disks)独立冗余阵列,旧称(Redundant Arry of Inexpensive Disks)廉价冗余阵列,其主要目的是将多个硬盘组成在一起来达到提高I/O.读写.冗余性. RAID分为硬件RAID和软件RAID 硬件RAID通过RAID卡连接多个硬盘.或者主板中集成了RAID控制器来实现RAID的相关功能. 软

CentOS 6.3下配置软RAID(Software RAID)

一.RAID 简介 RAID 是英文Redundant Array of IndependentDisks 的缩写,翻译成中文意思是"独立磁盘冗余阵列",有时也简称磁盘阵列(Disk Array). 简单的说,RAID是一种把多块独立的硬盘(物理硬盘)按不同的方式组合起来形成一个硬盘组(逻辑硬盘),从而提供比单个硬盘更高的存储性能和提供数据备份的技术. 组成磁盘阵列的不同方式称为RAID级别(RAID Levels),常见的RAID Level 包括raid0, raid1, raid

Centos 6下软raid操作脚本

#!/bin/sh main () { clear echo '          ------------------------------------------------------          ' echo '          1.Create a software raid array          ' echo '          2.View raid array sync status           ' echo '          3.View rai

Raid 介绍以及软raid的实现

RAID: old Redundant Arrays of Inexpensive Disks (廉价磁盘冗余阵列) new Redundant Arrays of Independent Disks (独立磁盘冗余阵列) Berkeley: A case for Redundent Arrays of Inexpensive Disks RAID 功能: 提高IO能力:磁盘并行读写: 提高耐用性:磁盘冗余来实现.但是raid不能取代数据备份,raid只是减少磁盘对于数据的影响.人为操作数据无法

Linux下做软RAID

1.查看有多少块硬盘可用#fdisk -l嗯,一般而言,留下系统盘不动,其它的盘如果大小相同的话,统统合起来做一个raid. 2.决定做什么类型的raid.raid-0.raid-1.raid-5?如果有三块一样大小的盘(或者更多),那么极力推荐raid-5.否则请根据实际情况选择raid-0或者raid-1 3.卸载已挂载的数据盘首先查看下,要做raid的几块盘是不是已经被挂载过了#mount如果有,那么挨个删除数据.然后用umount卸载.然后,还有,打开/etc/fstab,注释掉那些刚卸