다음 이전 차례

2. RAID 의 이해

  1. Q: RAID는 무엇인가? 왜 나는 아직 사용해 보지 않았는가?
    A: RAID 는 여러개의 디스크를 역어서, 속도와, 안전성이 좋은 하나의 형태로 만드는 것이다. RAID 는 여러가지 형태가 있고, 그 형태마다 각각의 장단점을 가지고 있다. 예를 들면 RAID 레벨 1 은 두개(혹은 이상)의 디스크에 같은 데이터의 복사본을 넣는 것이다. 데이터가 복사된 각 디스크에서 데이터를 가져오기 때문에 읽는 속도는 빨라질 것이다. 추가적으로 복사된 데이터는 하나의 디스크가 깨졌을 때 안정성을 제공할 것이다. RAID 레벨에 의한 다른 방법은, 여러개의 디스크를 하나의 디스크로 묶는 것이다. 그것은 간단한 복사에 비해 좀 더 많은 저장률을 제공할 것이다, 또한, 읽기 쓰기를 위한 성능 향상을 시키면서, 여전히 오류에 대비한 적당한 여유공간을 남겨둘 것이다.

    RAID is a way of combining multiple disk drives into a single entity to improve performance and/or reliability. There are a variety of different types and implementations of RAID, each with its own advantages and disadvantages. For example, by putting a copy of the same data on two disks (called disk mirroring, or RAID level 1), read performance can be improved by reading alternately from each disk in the mirror. On average, each disk is less busy, as it is handling only 1/2 the reads (for two disks), or 1/3 (for three disks), etc. In addition, a mirror can improve reliability: if one disk fails, the other disk(s) have a copy of the data. Different ways of combining the disks into one, referred to as RAID levels, can provide greater storage efficiency than simple mirroring, or can alter latency (access-time) performance, or throughput (transfer rate) performance, for reading or writing, while still retaining redundancy that is useful for guarding against failures.

    RAID는 디스크 오류에 대비할 수 있지만, 인간의 실수나, 프로그램의 오류에는 대비할 수 없다. (RAID 프로그램 자체도 오류를 포함할 수 있다.) net 상에는 RAID 설치에 익숙치 않은 관리자들이 그들의 데이터를 모두 잃어버리는 그런 비극적인 이야기 들이 많다. RAID는 백업의 대체 할 수 없음에 주의하라!

    Although RAID can protect against disk failure, it does not protect against operator and administrator (human) error, or against loss due to programming bugs (possibly due to bugs in the RAID software itself). The net abounds with tragic tales of system administrators who have bungled a RAID installation, and have lost all of their data. RAID is not a substitute for frequent, regularly scheduled backup.

    RAID 는 하드웨어 적으로, 특별한 디스크 콘트롤러로, 또는, 커널 모듈 같은 소프트웨어 적으로 구현될 수 있다. RAID 하드웨어 "디스크 콘트롤러"는 디스크 드라이브에 케이블을 연결할수 있게 해주는 것이다. 일반적으로 lISA/EISA/PCI/S-Bus/MicroChannel 슬롯에 장착할수 있는 카드형식이나, 어떤 것들은 일반적인 컨트롤러와 디스크사이를 연결해는 박스 형식이다.

    RAID can be implemented in hardware, in the form of special disk controllers, or in software, as a kernel module that is layered in between the low-level disk driver, and the file system which sits above it. RAID hardware is always a "disk controller", that is, a device to which one can cable up the disk drives. Usually it comes in the form of an adapter card that will plug into a ISA/EISA/PCI/S-Bus/MicroChannel slot. However, some RAID controllers are in the form of a box that connects into the cable in between the usual system disk controller, and the disk drives. Small ones may fit into a drive bay; large ones may be built into a storage cabinet with its own drive bays and power supply.

    최신의 빠른 CPU를 사용하는 RAID 하드웨어는 최고의 속도를 내긴 하지만, 그만큼 비쌀 것이다. 이유는 대부분이 보드상에 충분한 DSP 와 메모리를 가지고 있기 때문이다. 오래된 RAID 하드웨어는 DSP와 캐쉬의 병목현상으로 최신의 CPU를 사용하는 시스템의 속도를 저하시킬수 있다. 때로는, 일반적인 하드웨어와 소프트웨어 RAID 를 사용하는 것보다 더 느릴 것이다. 하드웨어 RAID가 소프트웨어 RAID에 비해 장점이 있을 수 있지만, 최근 대부분의 디스크 드라이브들에겐 그렇지 않다.? RAID 하드웨어는 일반적으로 다른 메이커와 모델의 하드들에게 호환성을 제공하지 않지만, 리눅스상의 소프트웨어 RAID는 어떤 특별한 설정없이 대부분의 하드웨어들이 잘 돌아갈 것이다.

    The latest RAID hardware used with the latest & fastest CPU will usually provide the best overall performance, although at a significant price. This is because most RAID controllers come with on-board DSP's and memory cache that can off-load a considerable amount of processing from the main CPU, as well as allow high transfer rates into the large controller cache. Old RAID hardware can act as a "de-accelerator" when used with newer CPU's: yesterday's fancy DSP and cache can act as a bottleneck, and it's performance is often beaten by pure-software RAID and new but otherwise plain, run-of-the-mill disk controllers. RAID hardware can offer an advantage over pure-software RAID, if it can makes use of disk-spindle synchronization and its knowledge of the disk-platter position with regard to the disk head, and the desired disk-block. However, most modern (low-cost) disk drives do not offer this information and level of control anyway, and thus, most RAID hardware does not take advantage of it. RAID hardware is usually not compatible across different brands, makes and models: if a RAID controller fails, it must be replaced by another controller of the same type. As of this writing (June 1998), a broad variety of hardware controllers will operate under Linux; however, none of them currently come with configuration and management utilities that run under Linux.

    소프트웨어 RAID는 커널 모듈로 설정하며, 관리 도구등도 모두 순수한 소프트웨어 적으로 이루어져 있다. 리눅스 RAID 시스템은 IDE, SCSI and Paraport drives 같은 저수준 드라이버와 block-device interface 위에 얇은 층으로 존재한다. ext2fs 나, DOS-FAT등의 파일시스템은 block-device interface위에 얻혀 있다. 소프트웨어 RAID는 소프트웨어적으로 매운 자연스러운 것이며, 하드웨어적 구현보다 유연한 것이다. 단점으로는 하드웨어 시스템보다 CPU cycle과 전원을 조금 더 소모한다는 것이지만, 가격이 비싸지는 것은 아니다. 소프트웨어 RAID는 파티션 단위로 움직이며, 각각의 파티션을 묶어서 RAID 파티션을 만들 수도 있다. 이것은 하드웨어적 구현과 크게 다른 점이며, 디스크들 전체를 하나로 묶어버릴 수도 있다. 그것은 하드웨어적으로는 운영체제로의 설정을 간단하고 명백히 할수 있고, 소프트웨어적으로는 좀 더 다양한 설정으로 복잡한 문제들에 접근할 수 있다.

    Software-RAID is a set of kernel modules, together with management utilities that implement RAID purely in software, and require no extraordinary hardware. The Linux RAID subsystem is implemented as a layer in the kernel that sits above the low-level disk drivers (for IDE, SCSI and Paraport drives), and the block-device interface. The filesystem, be it ext2fs, DOS-FAT, or other, sits above the block-device interface. Software-RAID, by its very software nature, tends to be more flexible than a hardware solution. The downside is that it of course requires more CPU cycles and power to run well than a comparable hardware system. Of course, the cost can't be beat. Software RAID has one further important distinguishing feature: it operates on a partition-by-partition basis, where a number of individual disk partitions are ganged together to create a RAID partition. This is in contrast to most hardware RAID solutions, which gang together entire disk drives into an array. With hardware, the fact that there is a RAID array is transparent to the operating system, which tends to simplify management. With software, there are far more configuration options and choices, tending to complicate matters.

    이 글이 쓰여지는 시점( 1998년 6월)에서, Linux하의 RAID의 설정은 어려운 것이고, 숙련된 시스템 관리자가 설정하는 것이 좋을 것이다. 방법은 너무 복잡하고 , startup script들의 수정을 필요로 한다. 디스크 에러로부터의 복구는 평범한 것이 아니고 사람의 실수로 이어지기 쉽다. RAID는 초보자를 위한 것이 아니다. 속도 향상과 안전성을 얻기 전에 의외의 복잡함에 허를 찔리기 쉬우니 조심하기 바란다.. 특히, 요즘 디스크들은 믿을 수 없을 만큼 안전하고 요즘 CPU와 컨트롤러는 충분히 강력하다. 당신은 질좋고 빠른 하드웨어의 구입으로 좀더 쉽게 원하는 만큼의 속도와 안정성을 얻을 수 있을 것이다.

    As of this writing (June 1998), the administration of RAID under Linux is far from trivial, and is best attempted by experienced system administrators. The theory of operation is complex. The system tools require modification to startup scripts. And recovery from disk failure is non-trivial, and prone to human error. RAID is not for the novice, and any benefits it may bring to reliability and performance can be easily outweighed by the extra complexity. Indeed, modern disk drives are incredibly reliable and modern CPU's and controllers are quite powerful. You might more easily obtain the desired reliability and performance levels by purchasing higher-quality and/or faster hardware.

  2. Q: RAID 레벨이 무엇인가요? 왜 그렇게 많은가요? 어떻게 구분하죠?
    A: 각 레벨마다, 속도와 사용공간, 안정성, 가격의 특성이 다르다. 모든 RAID 레벨의 과잉사용공간이 디스크 오류를 대비해 주는 것은 아니다. RAID-1과 RAID-5가 가장 많이 사용되며, RAID-1는 좀더 나은 속도를 내 줄 것이며, RAID-5는 좀 더 디스크의 여유공간을 많이 남겨줄것이다. 하지만, 속도가 레벨에 의해서 완전히 결정되는 것은 아니다. 속도는 사용할 프로그램, stripe,block,file 들의 크기등 다양한 요인에 많은 영향을 받는다. 이에 관해서는 이 뒤에서 자세히 다룰 것이다.

    The different RAID levels have different performance, redundancy, storage capacity, reliability and cost characteristics. Most, but not all levels of RAID offer redundancy against disk failure. Of those that offer redundancy, RAID-1 and RAID-5 are the most popular. RAID-1 offers better performance, while RAID-5 provides for more efficient use of the available storage space. However, tuning for performance is an entirely different matter, as performance depends strongly on a large variety of factors, from the type of application, to the sizes of stripes, blocks, and files. The more difficult aspects of performance tuning are deferred to a later section of this HOWTO.

    아래에서는 Linux 소프트웨어 RAID 구현의 다른 레벨들에 대해서 설명하고 있다.

    The following describes the different RAID levels in the context of the Linux software RAID implementation.

    • 선형 RAID (RAID-linear) 은 여러개의 파티션들을 연결해 하나의 큰 가상 파티션을 만드는 것이다. 이것은 작은 드라이브들을 여러개 가지고 있고 이것을 하나의 큰 파티션으로 만들고자 할때 유용할 것이다. 하지만, 이 연결은 안전성을 제공하지 않는다. 하나의 디스크에 오류가 나면, 묶여있는 파티션 전체가 오류가 날것이다.

      is a simple concatenation of partitions to create a larger virtual partition. It is handy if you have a number small drives, and wish to create a single, large partition. This concatenation offers no redundancy, and in fact decreases the overall reliability: if any one disk fails, the combined partition will fail.

    • RAID-1 는 "mirroring" 시키는 것이다. 두개 이상의 같은 크기를 가진 파티션들이 모두 블럭대 블럭으로 같은 데이터를 가지게 된다. 미러링은 디스크 오류에 아주 강력하다. 디스크 하나가 오류났을 때에도, 파손된 디스크와 완전히 똑같은 복제본이 있는 것이다. 미러링은 읽기 요청을 몇개의 디스크가 나누어 처리함으로써, I/O가 많은 시스템의 부하를 줄여줄수 있다. 하지만, 사용공간의 이용율에서 볼 때 미러링은 최악이다...

      is also referred to as "mirroring". Two (or more) partitions, all of the same size, each store an exact copy of all data, disk-block by disk-block. Mirroring gives strong protection against disk failure: if one disk fails, there is another with the an exact copy of the same data. Mirroring can also help improve performance in I/O-laden systems, as read requests can be divided up between several disks. Unfortunately, mirroring is also the least efficient in terms of storage: two mirrored partitions can store no more data than a single partition.

    • Striping 은 다른 RAID 레벨에 기본적인 개념이다. stripe는 디스크 블럭들이 연속적으로 붙어있는 것이다. stripe 는 하나의 디스크 블럭만큼 짧을 수도 있을 것이고, 수 천개의 블럭들로 이루어져 있을 수도 있을 것이다. RAID 드라이버는 디스크 파티션을 stripe 로 나눌 것이다. RAID 의 레벨은 stripe가 어떻게 구성되었는가. 어떤 데이터를 담고 있는가에 따라서 달라질 것이다. stripe의 크기와, 파일시스템안의 파일의 크기, 그것들의 디스크 안에서의 위치가 RAID 시스템의 전체적인 성능을 좌우할 것이다. (역자 덧, stripe는 띠인데.. 하나에 디스크에 있는게 아니라. 여러개의 디스크에서 같은 부분이 띠를 만드는 것이겠죠..)

      is the underlying concept behind all of the other RAID levels. A stripe is a contiguous sequence of disk blocks. A stripe may be as short as a single disk block, or may consist of thousands. The RAID drivers split up their component disk partitions into stripes; the different RAID levels differ in how they organize the stripes, and what data they put in them. The interplay between the size of the stripes, the typical size of files in the file system, and their location on the disk is what determines the overall performance of the RAID subsystem.

    • RAID-0 은 선형 RAID에 더 가깝다. 파티션을 stripe 들로 나누고 묶는 것이다. 선형 RAID처럼 결과는 하나의 큰 파티션이고, 그것은 과잉 공간이 없다. 역시 안전성도 줄어든다. 단순한 선형 RAID에 비해 성능이 향상되긴 하지만, 파일 시스템과, stripe 의 크기에 의해 생기는 파일의 일반적인 크기, 작업의 형태에 많은 의존을 한다.

      is much like RAID-linear, except that the component partitions are divided into stripes and then interleaved. Like RAID-linear, the result is a single larger virtual partition. Also like RAID-linear, it offers no redundancy, and therefore decreases overall reliability: a single disk failure will knock out the whole thing. RAID-0 is often claimed to improve performance over the simpler RAID-linear. However, this may or may not be true, depending on the characteristics to the file system, the typical size of the file as compared to the size of the stripe, and the type of workload. The ext2fs file system already scatters files throughout a partition, in an effort to minimize fragmentation. Thus, at the simplest level, any given access may go to one of several disks, and thus, the interleaving of stripes across multiple disks offers no apparent additional advantage. However, there are performance differences, and they are data, workload, and stripe-size dependent.

    • RAID-4 는 RAID-0 처럼 stripe로 나누는 방식을 사용한다. 하지만, parity 정보를 저장할 추가적인 파티션을 사용한다. parity 는 과잉 정보를 저장하는데 사용되고, 하나의 디스크에 오류가 났을 때, 남은 디스크의 데이터는 파손된 디스크의 데이터를 복구하는데 사용될 것이다. N 개의 디스크가 있고, 하나의 parity 디스크가 있다면, parity stripe는 각 디스크의 stripe 들의 XOR 연산으로 계산될 것이다. (N+1) 디스크를 가진 RAID-4 배열의 저장용량은 N 이 될것이다. 하지만, RAID-4는 미러링만큼 읽는 속도가 빠르지 않고 매번 디스크를 쓸 때마다 연산을 하고 parity 디스크에 써야 한다. 때문에 쓰기가 많은 시스템에는 매번 parity 디스크를 access 해야 하기 때문에, 병목현상이 일어날 수 있다.

      interleaves stripes like RAID-0, but it requires an additional partition to store parity information. The parity is used to offer redundancy: if any one of the disks fail, the data on the remaining disks can be used to reconstruct the data that was on the failed disk. Given N data disks, and one parity disk, the parity stripe is computed by taking one stripe from each of the data disks, and XOR'ing them together. Thus, the storage capacity of a an (N+1)-disk RAID-4 array is N, which is a lot better than mirroring (N+1) drives, and is almost as good as a RAID-0 setup for large N. Note that for N=1, where there is one data drive, and one parity drive, RAID-4 is a lot like mirroring, in that each of the two disks is a copy of each other. However, RAID-4 does NOT offer the read-performance of mirroring, and offers considerably degraded write performance. In brief, this is because updating the parity requires a read of the old parity, before the new parity can be calculated and written out. In an environment with lots of writes, the parity disk can become a bottleneck, as each write must access the parity disk.

    • RAID-5 는 각 드라이브마다 parity stripe 를 저장시킴으로써 RAID-4의 쓰기 병목현상을 피할수 있다. 그리나, 여전히 쓰기 전에 XOR 연산을 해야 하기 때문에 쓰기 성능은 미러링만큼 빨라질수 없다. 읽기 역시 여러개의 데이터가 있는 것이 아니기 때문에 미러링 만큼 빨라질 수 없다.

      avoids the write-bottleneck of RAID-4 by alternately storing the parity stripe on each of the drives. However, write performance is still not as good as for mirroring, as the parity stripe must still be read and XOR'ed before it is written. Read performance is also not as good as it is for mirroring, as, after all, there is only one copy of the data, not two or more. RAID-5's principle advantage over mirroring is that it offers redundancy and protection against single-drive failure, while offering far more storage capacity when used with three or more drives.

    • RAID-2 와 RAID-3 는 이제 거의 사용되지 않는다. 몇몇 레벨은 현대 디스크 기술로 인해 필요 없어졌기 때문이다. RAID-2는 RAID-4와 비슷하지만, parity 대신에 ECC 정보를 저장하는 것이 다르다. 현재의 모든 디스크들은 ECC 정보를 디스크 자체내에 넣어버렸다. 이것은, 디스크 자체에 작은 안전장치를 단 것이다. RAID-2 는 디스크 쓰기 도중 전원공급이 차단될 때, 데이터 안전성을 제공해준다. 하지만, 배터리 백업이나, clean shutdown 역시 똑같은 기능을 제공한다.. RAID-3은 가능한 최소의 stripe 크기를 사용하는 것을 제외하면 RAID-4 와 비슷하다. Linux 소프트웨어 RAID 드라이버는 RAID-2 와 RAID-3를 모두 지원하지 않는다.

      are seldom used anymore, and to some degree are have been made obsolete by modern disk technology. RAID-2 is similar to RAID-4, but stores ECC information instead of parity. Since all modern disk drives incorporate ECC under the covers, this offers little additional protection. RAID-2 can offer greater data consistency if power is lost during a write; however, battery backup and a clean shutdown can offer the same benefits. RAID-3 is similar to RAID-4, except that it uses the smallest possible stripe size. As a result, any given read will involve all disks, making overlapping I/O requests difficult/impossible. In order to avoid delay due to rotational latency, RAID-3 requires that all disk drive spindles be synchronized. Most modern disk drives lack spindle-synchronization ability, or, if capable of it, lack the needed connectors, cables, and manufacturer documentation. Neither RAID-2 nor RAID-3 are supported by the Linux Software-RAID drivers.

    • 그외의 RAID 레벨들은 다양한 수요와 판매자들에 의해 만들어졌고, 특별한 하드웨어를 필요로 하거나 어떤 것들은 저작권을 보호 받고 있다. Linux 소프트웨어 RAID는 다른 어떤 변종들도 지원하지 않는다.

      have been defined by various researchers and vendors. Many of these represent the layering of one type of raid on top of another. Some require special hardware, and others are protected by patent. There is no commonly accepted naming scheme for these other levels. Sometime the advantages of these other systems are minor, or at least not apparent until the system is highly stressed. Except for the layering of RAID-1 over RAID-0/linear, Linux Software RAID does not support any of the other variations.


다음 이전 차례