RAID là gì? (What does RAID do?) và có mấy loại RAID? (What types of RAID are there?)

detail here:
http://www.intel.com/support/vi/motherboards/server/sb/cs-010763.htm
http://www.nhatnghe.com/forum/showthread.php?t=17661
http://www.everything2.com/index.pl?node_id=1547503
RAID là gì và có mấy loại RAID ?
Trong những năm gần đây việc đầu tư raid cho máy tính để bàn hoặc cho những hệ thống máy tính lớn là điều cần thiết. Trong vài năm trước nghe nói raid có thể gọi là một thứ gì đó xa xỉ nhưng so với thị trường thiết bị máy tính ngày nay và với việc bị mất dữ liệu, hư ổ cứng thì điều mọi người nghĩ đến đầu tiên là sử dụng raid cho hệ thống của mình. Đa số các mainboard ngày nay đều có công nghệ RAID hoặc có hỗ trợ slot cắm card RAID Controller nhưng không phải ai cũng biết cách sử dụng hiệu quả. Bài viết tôi chỉ giới thiệu thông tin cơ bản về RAID. Về cách cấu hình , create array... raid cứng cũng như raid mềm thì các bạn search trong diễn đàn hoặc google hoặc đọc thêm document của máy.

A. Vậy RAID LÀ GÌ ?

RAID là chữ viết tắt của Redundant Array of Independent Disks. Ban đầu, RAID được sử dụng như một giải pháp phòng hộ vì nó cho phép ghi dữ liệu lên nhiều đĩa cứng cùng lúc. Về sau, RAID đã có nhiều biến thể cho phép không chỉ đảm bảo an toàn dữ liệu mà còn giúp gia tăng đáng kể tốc độ truy xuất dữ liệu từ đĩa cứng. Dưới đây là năm loại RAID được dùng phổ biến:

1. RAID 0

Đây là dạng RAID đang được người dùng ưa thích do khả năng nâng cao hiệu suất trao đổi dữ liệu của đĩa cứng. Đòi hỏi tối thiểu hai đĩa cứng, RAID 0 cho phép máy tính ghi dữ liệu lên chúng theo một phương thức đặc biệt được gọi là Striping. Ví dụ bạn có 8 đoạn dữ liệu được đánh số từ 1 đến 8, các đoạn đánh số lẻ (1,3,5,7) sẽ được ghi lên đĩa cứng đầu tiên và các đoạn đánh số chẵn (2,4,6,8) sẽ được ghi lên đĩa thứ hai. Để đơn giản hơn, bạn có thể hình dung mình có 100MB dữ liệu và thay vì dồn 100MB vào một đĩa cứng duy nhất, RAID 0 sẽ giúp dồn 50MB vào mỗi đĩa cứng riêng giúp giảm một nửa thời gian làm việc theo lý thuyết. Từ đó bạn có thể dễ dàng suy ra nếu có 4, 8 hay nhiều đĩa cứng hơn nữa thì tốc độ sẽ càng cao hơn. Tuy nghe có vẻ hấp dẫn nhưng trên thực tế, RAID 0 vẫn ẩn chứa nguy cơ mất dữ liệu. Nguyên nhân chính lại nằm ở cách ghi thông tin xé lẻ vì như vậy dữ liệu không nằm hoàn toàn ở một đĩa cứng nào và mỗi khi cần truy xuất thông tin (ví dụ một file nào đó), máy tính sẽ phải tổng hợp từ các đĩa cứng. Nếu một đĩa cứng gặp trục trặc thì thông tin (file) đó coi như không thể đọc được và mất luôn. Thật may mắn là với công nghệ hiện đại, sản phẩm phần cứng khá bền nên những trường hợp mất dữ liệu như vậy xảy ra không nhiều. Có thể thấy RAID 0 thực sự thích hợp cho những người dùng cần truy cập nhanh khối lượng dữ liệu lớn, ví dụ các game thủ hoặc những người chuyên làm đồ hoạ, video số.

2. RAID 1

Đây là dạng RAID cơ bản nhất có khả năng đảm bảo an toàn dữ liệu. Cũng giống như RAID 0, RAID 1 đòi hỏi ít nhất hai đĩa cứng để làm việc. Dữ liệu được ghi vào 2 ổ giống hệt nhau (Mirroring). Trong trường hợp một ổ bị trục trặc, ổ còn lại sẽ tiếp tục hoạt động bình thường. Bạn có thể thay thế ổ đĩa bị hỏng mà không phải lo lắng đến vấn đề thông tin thất lạc. Đối với RAID 1, hiệu năng không phải là yếu tố hàng đầu nên chẳng có gì ngạc nhiên nếu nó không phải là lựa chọn số một cho những người say mê tốc độ. Tuy nhiên đối với những nhà quản trị mạng hoặc những ai phải quản lý nhiều thông tin quan trọng thì hệ thống RAID 1 là thứ không thể thiếu. Dung lượng cuối cùng của hệ thống RAID 1 bằng dung lượng của ổ đơn (hai ổ 80GB chạy RAID 1 sẽ cho hệ thống nhìn thấy duy nhất một ổ RAID 80GB).

3. RAID 0+1

Có bao giờ bạn ao ước một hệ thống lưu trữ nhanh nhẹn như RAID 0, an toàn như RAID 1 hay chưa? Chắc chắn là có và hiển nhiên ước muốn đó không chỉ của riêng bạn. Chính vì thế mà hệ thống RAID kết hợp 0+1 đã ra đời, tổng hợp ưu điểm của cả hai “đàn anh”. Tuy nhiên chi phí cho một hệ thống kiểu này khá đắt, bạn sẽ cần tối thiểu 4 đĩa cứng để chạy RAID 0+1. Dữ liệu sẽ được ghi đồng thời lên 4 đĩa cứng với 2 ổ dạng Striping tăng tốc và 2 ổ dạng Mirroring sao lưu. 4 ổ đĩa này phải giống hệt nhau và khi đưa vào hệ thống RAID 0+1, dung lượng cuối cùng sẽ bằng ½ tổng dung lượng 4 ổ, ví dụ bạn chạy 4 ổ 80GB thì lượng dữ liệu “thấy được” là (4*80)/2 = 160GB.

4. RAID 5

Đây có lẽ là dạng RAID mạnh mẽ nhất cho người dùng văn phòng và gia đình với 3 hoặc 5 đĩa cứng riêng biệt. Dữ liệu và bản sao lưu được chia lên tất cả các ổ cứng. Nguyên tắc này khá rối rắm. Chúng ta quay trở lại ví dụ về 8 đoạn dữ liệu (1-8) và giờ đây là 3 ổ đĩa cứng. Đoạn dữ liệu số 1 và số 2 sẽ được ghi vào ổ đĩa 1 và 2 riêng rẽ, đoạn sao lưu của chúng được ghi vào ổ cứng 3. Đoạn số 3 và 4 được ghi vào ổ 1 và 3 với đoạn sao lưu tương ứng ghi vào ổ đĩa 2. Đoạn số 5, 6 ghi vào ổ đĩa 2 và 3, còn đoạn sao lưu được ghi vào ổ đĩa 1 và sau đó trình tự này lặp lại, đoạn số 7,8 được ghi vào ổ 1, 2 và đoạn sao lưu ghi vào ổ 3 như ban đầu. Như vậy RAID 5 vừa đảm bảo tốc độ có cải thiện, vừa giữ được tính an toàn cao. Dung lượng đĩa cứng cuối cùng bằng tổng dung lượng đĩa sử dụng trừ đi một ổ. Tức là nếu bạn dùng 3 ổ 80GB thì dung lượng cuối cùng sẽ là 160GB.

5. JBOD

JBOD (Just a Bunch Of Disks) thực tế không phải là một dạng RAID chính thống, nhưng lại có một số đặc điểm liên quan tới RAID và được đa số các thiết bị điều khiển RAID hỗ trợ. JBOD cho phép bạn gắn bao nhiêu ổ đĩa tùy thích vào bộ điều khiển RAID của mình (dĩ nhiên là trong giới hạn cổng cho phép). Sau đó chúng sẽ được “tổng hợp” lại thành một đĩa cứng lớn hơn cho hệ thống sử dụng. Ví dụ bạn cắm vào đó các ổ 10GB, 20GB, 30GB thì thông qua bộ điều khiển RAID có hỗ trợ JBOD, máy tính sẽ nhận ra một ổ đĩa 60GB. Tuy nhiên, lưu ý là JBOD không hề đem lại bất cứ một giá trị phụ trội nào khác: không cải thiện về hiệu năng, không mang lại giải pháp an toàn dữ liệu, chỉ là kết nối và tổng hợp dung lượng mà thôi.

6. Một số loại RAID khác

Ngoài các loại được đề cập ở trên, bạn còn có thể bắt gặp nhiều loại RAID khác nhưng chúng không được sử dụng rộng rãi mà chỉ giới hạn trong các hệ thống máy tính phục vụ mục đích riêng, có thể kể như: Level 2 (Error-Correcting Coding), Level 3 (Bit-Interleaved Parity), Level 4 (Dedicated Parity Drive), Level 6 (Independent Data Disks with Double Parity), Level 10 (Stripe of Mirrors, ngược lại với RAID 0+1), Level 7 (thương hiệu của tập đoàn Storage Computer, cho phép thêm bộ đệm cho RAID 3 và 4), RAID S (phát minh của tập đoàn EMC và được sử dụng trong các hệ thống lưu trữ Symmetrix của họ). Bên cạnh đó còn một số biến thể khác, ví dụ như Intel Matrix Storage cho phép chạy kiểu RAID 0+1 với chỉ 2 ổ cứng hoặc RAID 1.5 của DFI trên các hệ BMC 865, 875. Chúng tuy có nhiều điểm khác biệt nhưng đa phần đều là bản cải tiến của các phương thức RAID truyền thống.

B. BẠN CẦN GÌ ĐỂ CHẠY RAID?

Để chạy được RAID, bạn cần tối thiểu một card điều khiển (có thể là onboard hoặc card rời) và hai ổ đĩa cứng giống nhau. Đĩa cứng có thể ở bất cứ chuẩn nào, từ ATA, Serial ATA hay SCSI, SAS tốt nhất chúng nên hoàn toàn giống nhau vì một nguyên tắc đơn giản là khi hoạt động ở chế độ đồng bộ như RAID, hiệu năng chung của cả hệ thống sẽ bị kéo xuống theo ổ thấp nhất nếu có. Ví dụ khi bạn bắt ổ 160GB chạy RAID với ổ 40GB (bất kể 0 hay 1) thì coi như bạn đã lãng phí 120GB vô ích vì hệ thống điều khiển chỉ coi chúng là một cặp hai ổ cứng 40GB mà thôi (ngoại trừ trường hợp JBOD như đã đề cập). Yếu tố quyết định tới số lượng ổ đĩa chính là kiểu RAID mà bạn định chạy. Chuẩn giao tiếp không quan trọng lắm, đặc biệt là giữa SATA và ATA. Một số BMC đời mới cho phép chạy RAID theo kiểu trộn lẫn cả hai giao tiếp này với nhau. Điển hình như MSI K8N Neo2 Platinum hay dòng DFI Lanparty NForce4. Bộ điều khiển RAID (RAID Controller) là nơi tập trung các cáp dữ liệu nối các đĩa cứng trong hệ thống RAID và nó xử lý toàn bộ dữ liệu đi qua đó. Bộ điều khiển này có nhiều dạng khác nhau, từ card tách rời cho dến chip tích hợp trên BMC. Đối với các hệ thống PC, tuy chưa phổ biến nhưng việc chọn mua BMC có RAID tích hợp là điều nên làm vì nói chung đây là một trong những giải pháp cải thiện hiệu năng hệ thống rõ rệt và rẻ tiền nhất, chưa tính tới giá trị an toàn dữ liệu của chúng. Một thành phần khác của hệ thống RAID không bắt buộc phải có nhưng đôi khi là hữu dụng, đó là các khay hoán đổi nóng ổ đĩa. Nó cho phép bạn thay các đĩa cứng gặp trục trặc trong khi hệ thống đang hoạt động mà không phải tắt máy (chỉ đơn giản là mở khóa, rút ổ ra và cắm ổ mới vào). Thiết bị này thường sử dụng với ổ cứng SCSI hoặc SAS và khá quan trọng đối với các hệ thống máy chủ vốn yêu cầu hoạt động liên tục. Về phần mềm thì khá đơn giản vì hầu hết các hệ điều hành hiện đại đều hỗ trợ RAID rất tốt, đặc biệt là Microsoft Windows. Nếu bạn sử dụng Windows XP, 2k3... thì bổ sung RAID khá dễ dàng. Quan trọng nhất là trình điều khiển nhưng thật tuyệt khi chúng đã được kèm sẵn với thiết bị.
What does RAID do?

Specifically, RAID is designed to do three things: provide mirroring between disks, stripe data across disks to equally distribute data, and create parity information for data written across disks, so in the event of disk failure the striped data can be recreated.

The benefits of mirroring are that if a single disk fails there is real-time backup of all data and the system will continue to function normally. This gives a window of time to replace the failed disk and rebuild the mirror (which means to have the data from the surviving disk written to the new disk to re-establish mirroring). In addition, the speed of all read operations is improved to x times the speed of a single disk (let the number of disks equal x).

The benefits of striping are that two or more disks of size n can be linked together to create a new volume of size (n * x). In addition, the speed of all disk operations is improved by a factor of x.

The benefits of parity are such that in the event of any disk failure, it is possible to rebuild the entire array even if some data was written only to a disk that failed. Parity information is calculated such that it is possible to recreate lost data using parity data and remaining data on other drives. Speed of arrays with parity is generally lower than single disks because data parity must be calculated for each write, though this is not always the case as we will see later.
RAID restrictions

RAID functions best when the drives used in the configurations are the same type, speed and size. Differences in these characteristics can dramatically affect the speed of the array.
What types of RAID are there?

There are multiple types of RAID. Discussed so far have only been the most common. Below is a comprehensive list of the types of RAID. Only the most common will be fully explicated.
RAID 0 - This type of RAID is a striping array and requires a minimum of two drives to implement. In this configuration, data is written sequentially in equal parts, called blocks, to all drives in the array, maximizing the space used on all drives, and read from the drives simultaneously to increase the read speed.

Disk speed is maximized in this configuration. Because of this it is favored for applications that require very fast response times, such as video editing and databases.

Because data is only striped across disks, this is not considered true RAID: the data is not redundant and the failure of any drive in the array will result in the loss of all data on all drives.

Drives used in this type of array must be of the same size; differences in size will result in the size of each disk in the array being limited to the size of the smallest drive.

RAID 1 - This type of RAID is a mirroring array and requires a minimum of two drives to implement. In this configuration, data is written simultaneously to both drives and read from all drives simultaneously to increase the read speed.

Disk read speed is maximized in this configuration, though the write speed is equal to the speed of a single disk. Since the data is mirrored, the failure of any single drive in the mirrored array does not affect the integrity of the data.

Drives used in this type of array must be of the same size; differences in size will result in the size of the array being limited to the size of the smallest drive.

RAID 2 - This type of RAID is not commercially implemented by any manufacturer of RAID software or hardware. The array itself consists of two sets of arrays: one which has the data recorded, and a second which records ECC data for the data written to the first array. When the data is read, its ECC information is read as well to do on-the-fly error correction.

Disk speed can be very high, but the number of disks required to implement this type of setup is large.

RAID 3 - This type of RAID is a striping parity array and requires a minimum of three disks to implement. In this configuration, data is striped across a minimum of two disks with parity information generated and stored on a third disk.

Disk speed is maximized in this configuration, and single disk failure does not result in the loss of data as the parity information can be used to repair the array with the addition of a new disk.

Disks used in this type of array must be of the same size; differences in size will result in the size of the array being limited to the size of the smallest drive.

RAID 4 - This type of RAID has each drive in the array act independently with parity data written to an additional drive and requires a minimum of three disks to implement. In this configuration, data is neither striped nor mirrored but does have parity information generated for the recovery of any single disk failure.

Disk speed is limited to the size of any single disk with additional overhead for the generation of parity data.

Disks used in this type of array may be of different sizes as each drive acts independently of the other drives.

This type of array is rarely implemented.

RAID 5 - This type of RAID is a striping parity array and requires a minimum of three disks to implement. In this configuration, data is striped across all disks in the array and the generated parity information is striped across all disks in the array. This is the most common and general RAID level due to its high level of redundancy.

Disk read speed is maximized in this configuration and write speed is improved as all data is striped across the disks. This array can sustain disk failure and continue functioning due to the parity data.

Drives used in this type of array must be of the same size; differences in size will result in the size of the array being limited to the size of the smallest drive.

RAID 6 - This type of RAID is a striping parity array and requires a minimum of (x + 2) drives to implement. In this configuration, data is striped across all disks in the array and the generated parity information is striped across all disks in the array. In addition, a second set of parity data is generated and striped across all disks in the array.

This type of array is identical to RAID 5 with the exception that an additional parity set is created for all data. In this configuration the array can sustain multiple disk failures while retaining data integrity.

This type of array is generally recommended for mission-critical applications where the possibility of multiple disk failure is not acceptable. In general, RAID 6 will be slower than RAID 5 because of the doubled computational requirements of the parity data generation.

Drives used in this type of array must be of the same size; differences in size will result in the size of the array being limited to the size of the smallest drive.

RAID 10 - This type of RAID is a striping mirrored array and requires a minimum of four disks to implement. In this configuration, data is striped across two disks (in a four disk configuration), and the data striped is then copied to an independent mirror consisting of two disks (the data is written in the stripe, then written to one of the two remaining disks; when written to one of the two remaining disks, it is then mirrored--in this configuration, there is a stripe set and a mirror set).

This type of array has the same level of fault tolerance and speed as RAID 1. This type of configuration is recommended for systems requiring the speed of striping but with the fault tolerance of mirroring that data.

Drives used in this type of array must be of the same size; differences in size will result in the size of the array being limited to the size of the smallest drive.

RAID 50 - This type of RAID is a striping array with parity information stored on a separate disk. The parity information is then striped on separate disks. Because of this, it requires a minimum of five disks to implement and is similar to RAID 3.

This type of array is rarely implemented because of poor use of space.

RAID 0+1 - This type of RAID is a mirrored striping array and requires a minimum of four disks to implement. In this configuration (four disks), data is striped across two disks for the benefits of RAID 0, which is then mirrored on two additional disks for the redundancy of RAID 1.

This type of array has the same level of fault tolerance of RAID 5, but has the capacity of one-half the total capacity of the disks used.

RAID 0+1 should not be confused with RAID 10; disk failure in this array will result in the array being the equivalent of a RAID 0 array.

JBOD - This is not true RAID, and stands for "Just a Bunch of Disks." In this configuration, which requires a minimum of two disks, data is written to each disk in the array until that disk is full. Once that disk is full, data is written to the next disk in the array. This mode of writing is referred to as linear append. It offers no redundancy and no speed improvements. In addition, disks may be of different sizes without limiting the total capacity of the array.

Nhận xét

Bài đăng phổ biến từ blog này

Ký tự viết tắt trong chat & email

dung lượng RAM lớn nhất mà HĐH cấu trúc 32-bit nhận được

Ubuntu LAMP Server