「RAID」- 基本概念及工作原理

问题描述

该笔记将记录:与 RAID 工作原理、技术细节相关;

Stripe, Stripe Unit, Stripe Size

Optimal RAID Stripe Size and filesystem Readahead for RAID-10?

写入 RAID 的数据会被分解为较小的数据块,然后再将数据块写入磁盘,这些数据块就是 Stripe Unit,其大小为 Stripe Size,横向的多个 Stripe Unit 组成 Stripe;

以 RAID 0 例:

Stripe Unit

在 RAID 0 中的 stripe unit 是指将数据分成的固定大小的块。每个块称为 stripe unit。在 RAID 0 中,数据被分成几个 stripe unit,并且这些 stripe unit 被分别存储在不同的磁盘上。

A1~A8 皆为 Stripe Unit,图示包含 8 个 Stripe Unit;

Stripe Size

Stripe size 是 RAID 0 中指定的每个 stripe unit 的大小。它是将数据分成 stripe unit 的基本单位,通常是以字节为单位进行度量。

A1~A8 的大小相同,其大小为 Stripe Size;

通常 Stripe Size 取值在 128KB~256KB 之间;

Stripe

多个 Stripe Unit 组成一个 Stripe;

A1+A2 为一个 Stripe,A3+A4 为一个 Stripe,所以图示包含 4 个 Stripe;

实现方式

磁盘阵列有三种实现方式:(1)外接式磁盘阵列柜;(2)内接式磁盘阵列卡;(3)软件模拟(软阵列)

外接式磁盘阵列柜

磁盘阵列柜是装配众多硬盘的外置磁盘阵列,常在大型服务器上使用。该设备具有多个接口,可以物理服务器直接相连,提供存储功能;

在机房中可以见到外接式磁盘阵列柜,它通常是单独的设备;

内接式磁盘阵列卡

在物理服务器(或工作站)中,通常具有内置磁盘阵列卡。它是独立的硬件模块,具有专用的处理单元;

软件模拟(软阵列)

常见于低成本或无法使用硬件的环境中,利用软件模拟,将众多磁盘组成磁盘阵列;

缺点:
1)该方式组成的磁盘阵列,性能会有所损失;
2)同时会消耗系统资源,不适合大数据流量的服务器;
3)支持有限的磁盘阵列级别;

优点:
1)成本低,无需购买额外硬件设备;
2)当然,既然是磁盘阵列,因此它也具备磁盘阵列的优点;

IT mode, HBA mode, RAID mode in (SAS) Controllers

百度百科 / 磁盘阵列
百度百科 / 磁盘阵列柜

RAID mode

RAID mode: (Redundant Array of Independent Disks) mode, the controller will work in RAID mode, the operating system will not see each individual disks

HBA mode

Solved: Switch PERC H750 to HBA mode – Dell Community
Dell PowerEdge RAID Controller 11 User’s Guide …

HBA mode: (Host Bus Adapter) mode, the controller will not work in RAID mode, so that the operating system can see each disks individually

(Dell’s Firmware has RAID mode and HBA mode)

Dell 部分 Controller 并不支持 HBA mode,但是其支持磁盘 Non–RAID 模式,能够实现个别磁盘直通操作系统;

IT mode

IT mode: (Initiator Target) mode, the controller will not work in RAID mode, so that the operating system can see each disks individually

(LSI/Broadcom’s Firmware has RAID mode and IT mode)

Basically HBA mode and IT mode are the same, just different vendors give the non-RAID mode different names