Software-RAID HOWTO
Software-RAID HOWTO
Linas Vepstas, linas@linas.orgv0.54, 21 November 1998
최 희철 ironyjk@kldp.org
2000년 3월 1일
RAID 는 ''Redundant Array of Inexpensive Disks'' 의 약자로,
각각의 디스크 들을 묶어서 빠르고 안전한 디스크 시스템을 만드는 것이다.
RAID 는 하나의 디스크에 비해 오류를 대비할 수 있으며,
속도를 증가 시킨다.
RAID stands for ''Redundant Array of Inexpensive Disks'', and
is meant to be a way of creating a fast and reliable disk-drive
subsystem out of individual disks. RAID can guard against disk
failure, and can also improve performance over that of a single
disk drive.
이 문서는 Linux MD kernel 확장에 관한 tutorial/HOWTO/FAQ 문서이다.
MD 확장은 RAID-0,1,4,5 를 소프트웨어 적으로 지원하고,
이것을 통해 우리는 특별한 하드웨어나 디스크 콘트롤러 없이
RAID 를 사용해 볼수 있다.
This document is a tutorial/HOWTO/FAQ for users of
the Linux MD kernel extension, the associated tools, and their use.
The MD extension implements RAID-0 (striping), RAID-1 (mirroring),
RAID-4 and RAID-5 in software. That is, with MD, no special hardware
or disk controllers are required to get many of the benefits of RAID.
- 머리말
-
This document is copyrighted and GPL'ed by Linas Vepstas
(
linas@linas.org).
Permission to use, copy, distribute this document for any purpose is
hereby granted, provided that the author's / editor's name and
this notice appear in all copies and/or supporting documents; and
that an unmodified version of this document is made freely available.
This document is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, either expressed or implied. While every effort
has been taken to ensure the accuracy of the information documented
herein, the author / editor / maintainer assumes NO RESPONSIBILITY
for any errors, or for any damages, direct or consequential, as a
result of the use of the information documented herein.
본 문서의 황당하고 무책임한 번역으로 인한 정신적 물리적 피해를 역자는 책임을 지지 않습니다. ^^
(번역이 처음이다 보니, 이 문서에 오역이 조금(?) 있습니다.)
이 문서는 GPL을 따릅니다. 오역과 잘못된, 갱신해야 할 정보에 관해서는
저에게 메일을 주시기 바랍니다.
번역이라고 하긴 했는데 엉성하기 그지 없군요. 좀 더 자세한 번역을 하고 싶긴 하지만.
잘 모르는 것도 많고 더 하고 싶은 것도 많아서 ^^;
RAID는 디스크의 추가로 시스템의 신뢰성을 향상시킬수 있으나,
잘못된 사용으로 인해 역효과를 낼 수도 있다.
특히 , RAID는 디스크 자체의 오류에 대비한 것이지.
사용자의 실수나, 전원의 불량에 대비하도록 설계된 것이 아니다.
전원의 불량과, 개발 커널, 그리고, 관리자의 실수는 데이터를
손상시킬 것이고, RAID 는 백업방법이 아님에 유의하라.
RAID, although designed to improve system reliability by adding
redundancy, can also lead to a false sense of security and confidence
when used improperly. This false confidence can lead to even greater
disasters. In particular, note that RAID is designed to protect against
*disk* failures, and not against *power* failures or *operator*
mistakes. Power failures, buggy development kernels, or operator/admin
errors can lead to damaged data that it is not recoverable!
RAID is *not* a substitute for proper backup of your system.
Know what you are doing, test, be knowledgeable and aware!
- Q:
RAID 란 무엇인가?
A
RAID 는 ''Redundant Array of Inexpensive Disks' 의 약자로,
각각의 디스크 들을 묶어서 빠르고 안전한 디스크 시스템을 만드는 것이다.
RAID stands for "Redundant Array of Inexpensive Disks",
and is meant to be a way of creating a fast and reliable disk-drive
subsystem out of individual disks. In the PC world, "I" has come to
stand for "Independent", where marketing forces continue to
differentiate IDE and SCSI. In it's original meaning, "I" meant
"Inexpensive as compared to refrigerator-sized mainframe
3380 DASD", monster drives which made nice houses look cheap,
and diamond rings look like trinkets.
- Q:
이 문서는 무엇인가?
A:
이 문서는 Linux MD kernel 확장에 관한 tutorial/HOWTO/FAQ 문서이다.
MD 확장은 RAID-0,1,4,5 를 소프트웨어 적으로 지원하고,
이것을 통해 우리는 특별한 하드웨어나 디스크 콘트롤러 없이
RAID 를 사용해 볼수 있다.
This document is a tutorial/HOWTO/FAQ for users of the Linux MD
kernel extension, the associated tools, and their use.
The MD extension implements RAID-0 (striping), RAID-1 (mirroring),
RAID-4 and RAID-5 in software. That is, with MD, no special
hardware or disk controllers are required to get many of the
benefits of RAID.
This document is NOT an introduction to RAID;
you must find this elsewhere.
- Q:
Linux 커널은 어떤 레벨의 RAID 를 지원하는가?
A:
RAID-0 은 2.x 버전의 리눅스 커널들이 지원한다.
이것은 이해하기 쉽고, 몇몇의 매우 큰 유즈넷 뉴스 서버에 사용된다.
Striping (RAID-0) and linear concatenation are a part
of the stock 2.x series of kernels. This code is
of production quality; it is well understood and well
maintained. It is being used in some very large USENET
news servers.
RAID-1, RAID-4, RAID-5 는 커널 2.1.63 이상의 버전에서 지원한다.
2.0.x 와 2.1.x의 커널들은 패치를 해야 한다.
커널을 업그레이드 해야 한다고 생각하지 마라. 업그레이드보다.
패치가 훨씬 쉬울 것이다.
RAID-1, RAID-4 & RAID-5 are a part of the 2.1.63 and greater
kernels. For earlier 2.0.x and 2.1.x kernels, patches exist
that will provide this function. Don't feel obligated to
upgrade to 2.1.63; upgrading the kernel is hard; it is *much*
easier to patch an earlier kernel. Most of the RAID user
community is running 2.0.x kernels, and that's where most
of the historic RAID development has focused. The current
snapshots should be considered near-production quality; that
is, there are no known bugs but there are some rough edges and
untested system setups. There are a large number of people
using Software RAID in a production environment.
RAID-1 hot reconstruction has been recently introduced
(August 1997) and should be considered alpha quality.
RAID-5 hot reconstruction will be alpha quality any day now.
A word of caution about the 2.1.x development kernels:
these are less than stable in a variety of ways. Some of
the newer disk controllers (e.g. the Promise Ultra's) are
supported only in the 2.1.x kernels. However, the 2.1.x
kernels have seen frequent changes in the block device driver,
in the DMA and interrupt code, in the PCI, IDE and SCSI code,
and in the disk controller drivers. The combination of
these factors, coupled to cheapo hard drives and/or
low-quality ribbon cables can lead to considerable
heartbreak. The ckraid tool, as well as
fsck and mount put considerable stress
on the RAID subsystem. This can lead to hard lockups
during boot, where even the magic alt-SysReq key sequence
won't save the day. Use caution with the 2.1.x kernels,
and expect trouble. Or stick to the 2.0.34 kernel.
- Q:
어디에서 커널의 패치를 구할 수 있나요?
A:
Software RAID-0 and linear mode are a stock part of
all current Linux kernels. Patches for Software RAID-1,4,5
are available from
http://luthien.nuclecu.unam.mx/~miguel/raid.
See also the quasi-mirror
ftp://linux.kernel.org/pub/linux/daemons/raid/
for patches, tools and other goodies.
- Q:
Linux RAID 에 관한 다른 문서들이 있나요?
A:
- Q:
이 문서에 대해 누구에게 불평해야 하죠?
A:
Linas Vepstas slapped this thing together.
However, most of the information,
and some of the words were supplied by
Copyrights
- Copyright (C) 1994-96 Marc ZYNGIER
- Copyright (C) 1997 Gadi Oxman, Ingo Molnar, Miguel de Icaza
- Copyright (C) 1997, 1998 Linas Vepstas
- By copyright law, additional copyrights are implicitly held
by the contributors listed above.
Thanks all for being there!
- 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.
- 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.
- Q:
Software RAID 를 어떻게 설치해야 가장 좋을 까요?
A:
나는 파일 시스템 계획이 좀 더 어려운 유닉스 설정작업인 것을
깨닫 도록 남겨둔다.
질문에 대한 대답으로, 우리가 한 일을 설명하겠다.
우리는 각각 2.1 기가의 EIDE 디스크를 아래와 같이 설정할 계획을 세웠다.
I keep rediscovering that file-system planning is one
of the more difficult Unix configuration tasks.
To answer your question, I can describe what we did.
We planned the following setup:
- two EIDE disks, 2.1.gig each.
disk partition mount pt. size device
1 1 / 300M /dev/hda1
1 2 swap 64M /dev/hda2
1 3 /home 800M /dev/hda3
1 4 /var 900M /dev/hda4
2 1 /root 300M /dev/hdc1
2 2 swap 64M /dev/hdc2
2 3 /home 800M /dev/hdc3
2 4 /var 900M /dev/hdc4
- 각 디스크는 모두 분리된 컨트롤러와 리본 케이블 상에 있다.
이것은 하나의 컨트롤러나 케이블이 고장 났을 때,
디스크들이 같이 사용 불가능하게 되는 것을 막아준다.
Each disk is on a separate controller (& ribbon cable).
The theory is that a controller failure and/or
ribbon failure won't disable both disks.
Also, we might possibly get a performance boost
from parallel operations over two controllers/cables.
- 루트 파티션 (
/ /dev/hda1 )에 리눅스 커널을
설치할 것이다. 이 파티션을 bootable로 설정해라.
Install the Linux kernel on the root (/)
partition /dev/hda1. Mark this partition as
bootable.
- /dev/hac1은 /dev/hda1 의 RAID 복사본이 아닌
단순 복사본이다. 이것으로, 첫번째 디스크가 오류났을 때
rescue 디스크를 사용해 이 파티션을 bootable 설정하여
시스템을 다시 인스톨하지 않고 사용할 수 있다.
/dev/hdc1 will contain a ``cold'' copy of
/dev/hda1. This is NOT a raid copy,
just a plain old copy-copy. It's there just in
case the first disk fails; we can use a rescue disk,
mark /dev/hdc1 as bootable, and use that to
keep going without having to reinstall the system.
You may even want to put /dev/hdc1's copy
of the kernel into LILO to simplify booting in case of
failure.
이것은 심각한 문제 발생시, raid superblock-corruption 이나
다른 이해할수 없는 문제에 대한 걱정없이 시스템을 부팅할 수
있게 해준다.
The theory here is that in case of severe failure,
I can still boot the system without worrying about
raid superblock-corruption or other raid failure modes
& gotchas that I don't understand.
/dev/hda3 와 /dev/hdc3 는
미러링을 통해 /dev/md0 가 될것이다.
/dev/hda3 and /dev/hdc3 will be mirrors
/dev/md0.
/dev/hda4 와 /dev/hdc4 는
미러링을 통해 /dev/md1 가 될것이다.
/dev/hda4 and /dev/hdc4 will be mirrors
/dev/md1.
- 우리는 아래와 같은 이유로 파티션을 나누고,
/var 와 /home
파티션을 미러링하기로 결정하였다.
we picked /var and /home to be mirrored,
and in separate partitions, using the following logic:
/ (루트 파티션)의 데이터들은 상대적으로
잘 변하지 않는다.
/ (the root partition) will contain
relatively static, non-changing data:
for all practical purposes, it will be
read-only without actually being marked &
mounted read-only.
/home 파티션은 ''천천히'' 변하는 데이터를
가지고 있다.
/home will contain ''slowly'' changing
data.
/var> 는 메일 spool , 데이터베이스 내용,
웹 서버의 log 와 같은 급속히 변하는 데이터를
포함하고 있다.
/var will contain rapidly changing data,
including mail spools, database contents and
web server logs.
이렇게 여러개의 다른 파티션을 나누는 것은,
인간의 실수, 전원, 혹은 os의 문제등이 일어났을 때,
그것이 미치는 영향이 하나의 파티션에만 한정되기 때문이다.
The idea behind using multiple, distinct partitions is
that if, for some bizarre reason,
whether it is human error, power loss, or an operating
system gone wild, corruption is limited to one partition.
In one typical case, power is lost while the
system is writing to disk. This will almost certainly
lead to a corrupted filesystem, which will be repaired
by fsck during the next boot. Although
fsck does it's best to make the repairs
without creating additional damage during those repairs,
it can be comforting to know that any such damage has been
limited to one partition. In another typical case,
the sysadmin makes a mistake during rescue operations,
leading to erased or destroyed data. Partitions can
help limit the repercussions of the operator's errors.
-
/usr 와 /opt 파티션을 선택하여도 괜찮았을 것이다.
사실, 하드가 좀더 있었다면, /opt 와 /home 파티션을
RAID-5 로 설정하는 것이 더 좋았을 것이다.
주의할 점은 /usr 파티션을 RAID-5로 설정하지 말라는 것이다.
심각한 문제가 일어났을 경우 /usr 파티션에 마운트 할수 없게
될 것이고, /usr 파티션안의 네트워크 툴과 컴파일러 같은 것들을
필요로 하게 될 것이다. RAID-1을 사용한다면, 이런 에러가 났을때,
RAID는 사용할수 없어도 두개의 미러링된 것중 하나에는 마운트가 가능하다.
Other reasonable choices for partitions might be
/usr or /opt. In fact, /opt
and /home make great choices for RAID-5
partitions, if we had more disks. A word of caution:
DO NOT put /usr in a RAID-5
partition. If a serious fault occurs, you may find
that you cannot mount /usr, and that
you want some of the tools on it (e.g. the networking
tools, or the compiler.) With RAID-1, if a fault has
occurred, and you can't get RAID to work, you can at
least mount one of the two mirrors. You can't do this
with any of the other RAID levels (RAID-5, striping, or
linear append).
그래서 질문에 대한 완성된 답은:
- 첫번째 디스크의 첫번째 파티션에 운영체제를 설치하고
다른 파티션들은 마운트하지 말아라.
install the OS on disk 1, partition 1.
do NOT mount any of the other partitions.
- 명령단위로 RAID를 설치하라.
install RAID per instructions.
-
md0 와 md1. 설정하라.
configure md0 and md1.
- 디스크 오류가 일어났을 때 무엇을 해야 하는 지
준비해라. 관리자가 지금 실수하는지 찾아보고,
타격을 입게 놔두지 마라. 그리고 경험을 쌓아라.
(우리는 디스크가 작동하고 있는 동안, 전원을 꺼보았다.
이것은 멍청해보이지만, 정보를 얻을 수 있다.)
convince yourself that you know
what to do in case of a disk failure!
Discover sysadmin mistakes now,
and not during an actual crisis.
Experiment!
(we turned off power during disk activity —
this proved to be ugly but informative).
-
/var 를 /dev/md1으로 옮기는 중,
어느 정도 잘못된 mount/copy/unmount/rename/reboot 을 해보라.
조심히만 한다면, 위험하지는 않을 것이다.
do some ugly mount/copy/unmount/rename/reboot scheme to
move /var over to the /dev/md1.
Done carefully, this is not dangerous.
- 그리고, 그것들을 즐겨라.
- Q:
mdadd, mdrun 등의 명령과 raidadd, raidrun 명령의
다른 점이 뭔가요?
A:
raidtools 패키지의 0.5 버젼부터 이름이 바뀌었다. md로 이름이 붙는 것은 0.43 이전버젼이고
raid로 이름이 붙는 것은 0.5 버젼과 더 새버젼들이다..
The names of the tools have changed as of the 0.5 release of the
raidtools package. The md naming convention was used
in the 0.43 and older versions, while raid is used in
0.5 and newer versions.
- Q:
가지고 있는 2.0.34 커널에서 RAID-linear 와 RAID-0 를 사용하고 싶다.
RAID-linear 와 RAID-0 을 위해서 패치가 필요하지 않기 때문에.
raid 패치는 하고 싶지 않다. 어디에 가면, 이것들을 위한 raid-tool 을
구할수 있나?
A:
과겨한 질문이다. 사실, 최신의 raid tool들은 컴파일 하기 위해
RAID-1,4,5 커널 패치를 필요로 한다.
현재 raid tool의 컴파일된 바이너리 버젼찾지 못했다.
하지만, 2.1.100 커널에서 컴파일된 바이너리가 2.0.34 커널에서
RAID-0/linear 파티션을 만드는 것을 잘 수행하는 것을 보았다.
그래서, 나는
http://linas.org/linux/Software-RAID/ 에 mdadd,mdcreate등의
바이너리를 임시적으로 올린다.
This is a tough question, indeed, as the newest raid tools
package needs to have the RAID-1,4,5 kernel patches installed
in order to compile. I am not aware of any pre-compiled, binary
version of the raid tools that is available at this time.
However, experiments show that the raid-tools binaries, when
compiled against kernel 2.1.100, seem to work just fine
in creating a RAID-0/linear partition under 2.0.34. A brave
soul has asked for these, and I've temporarily
placed the binaries mdadd, mdcreate, etc.
at http://linas.org/linux/Software-RAID/
You must get the man pages, etc. from the usual raid-tools
package.
- Q:
루트 파티션에 RAID를 적용할 수 있는가?
왜 md 디스크로 직접 부팅할 수 없는가?
A:
LILO와 Loadlin 모두 RAID 파티션에서 커널이미지를 읽어올 수 없다.
루트 파티션에 RAID를 적용하고 싶다면, 커널을 저장할
RAID가 아닌 파티션을 만들어야 할것이다.
(일반적으로 이 파티션의 이름은 /boot이다.)
<
HarryH@Royal.Net>
로부터 받은 initial ramdisk (initrd) 또는, 패치는 RAID 디스크를 root 디바이스로
사용가능하게 해 줄것이다.
(이 패치는 최근 2.1.x커널에는 기본적으로 채택되어있다.)
Both LILO and Loadlin need an non-stripped/mirrored partition
to read the kernel image from. If you want to strip/mirror
the root partition (/),
then you'll want to create an unstriped/mirrored partition
to hold the kernel(s).
Typically, this partition is named /boot.
Then you either use the initial ramdisk support (initrd),
or patches from Harald Hoyer
<
HarryH@Royal.Net>
that allow a stripped partition to be used as the root
device. (These patches are now a standard part of recent
2.1.x kernels)
거기에는 사용할 수 있는 몇가지 방법이 있는데, 하나는
Bootable RAID mini-HOWTO:
ftp://ftp.bizsystems.com/pub/raid/bootable-raid에
자세히 설명되어 있다.
There are several approaches that can be used.
One approach is documented in detail in the
Bootable RAID mini-HOWTO:
ftp://ftp.bizsystems.com/pub/raid/bootable-raid.
또는, 아래처럼 mkinitrd 를 사용해 ramdisk image를 만들수도 있다.
Alternately, use mkinitrd to build the ramdisk image,
see below.
Edward Welbon
<
welbon@bga.com>
writes:
- ... all that is needed is a script to manage the boot setup.
To mount an
md filesystem as root,
the main thing is to build an initial file system image
that has the needed modules and md tools to start md.
I have a simple script that does this.
- For boot media, I have a small cheap SCSI disk
(170MB I got it used for $20).
This disk runs on a AHA1452, but it could just as well be an
inexpensive IDE disk on the native IDE.
The disk need not be very fast since it is mainly for boot.
- This disk has a small file system which contains the kernel and
the file system image for
initrd.
The initial file system image has just enough stuff to allow me
to load the raid SCSI device driver module and start the
raid partition that will become root.
I then do an
echo 0x900 > /proc/sys/kernel/real-root-dev
(0x900 is for /dev/md0)
and exit linuxrc.
The boot proceeds normally from there.
- I have built most support as a module except for the AHA1452
driver that brings in the
initrd filesystem.
So I have a fairly small kernel. The method is perfectly
reliable, I have been doing this since before 2.1.26 and
have never had a problem that I could not easily recover from.
The file systems even survived several 2.1.4[45] hard
crashes with no real problems.
- At one time I had partitioned the raid disks so that the initial
cylinders of the first raid disk held the kernel and the initial
cylinders of the second raid disk hold the initial file system
image, instead I made the initial cylinders of the raid disks
swap since they are the fastest cylinders
(why waste them on boot?).
- The nice thing about having an inexpensive device dedicated to
boot is that it is easy to boot from and can also serve as
a rescue disk if necessary. If you are interested,
you can take a look at the script that builds my initial
ram disk image and then runs
LILO.
http://www.realtime.net/~welbon/initrd.md.tar.gz
It is current enough to show the picture.
It isn't especially pretty and it could certainly build
a much smaller filesystem image for the initial ram disk.
It would be easy to a make it more efficient.
But it uses LILO as is.
If you make any improvements, please forward a copy to me. 8-)
- Q:
striping 위에 미러링이 가능하다고 들었는데, 사실인가?
loopback 장치로 미러링할 수 있는가?
A:
그렇다. 하지만, 그 반대로는 안된다.
Yes, but not the reverse. That is, you can put a stripe over
several disks, and then build a mirror on top of this. However,
striping cannot be put on top of mirroring.
간단히 기술적인 설명을 덧붙이자면, linear 와 stripe는
자체적으로 ll_rw_blk 루틴을 사용하는 데 이것은
block 를 사용하지 않고 디스크 device와 sector를 사용해
정식적으로, 그리고 저수준의 access를 한다, 때문에,
다른 미러링위에 위치시킬수 없다.
A brief technical explanation is that the linear and stripe
personalities use the ll_rw_blk routine for access.
The ll_rw_blk routine
maps disk devices and sectors, not blocks. Block devices can be
layered one on top of the other; but devices that do raw, low-level
disk accesses, such as ll_rw_blk, cannot.
현재 (1997년 11월) RAID는 loopback device를 지원하지 않지만,
곧 지원할 것이다.
Currently (November 1997) RAID cannot be run over the
loopback devices, although this should be fixed shortly.
- Q:
두개의 작은 디스크와 세개의 큰 디스크를 가지고 있을때,
작은 디스크 두개를 RAID-0으로 묶은 후, 나머지 디스크들과,
RAID-5를 만들수 있는가?
A:
1997년 11월 현재, RAID-5로 묶을 수는 없다.
묶여진 디스크들로는 RAID-1(미러링)만 가능하다.
Currently (November 1997), for a RAID-5 array, no.
Currently, one can do this only for a RAID-1 on top of the
concatenated drives.
- Q:
두개의 디스크로 RAID-1 을 설정하는 것과, RAID-5를 설정하는 것이
어떻게 다른가?
A:
데이터의 저장율에는 차이가 없다. 디스크를 더 붙힌다고 저장율이
늘어가는 것도 아니다.
There is no difference in storage capacity. Nor can disks be
added to either array to increase capacity (see the question below for
details).
RAID-1 은 각 드라이브에서 두 섹터를 동시에 읽는 분산 기술을 사용하기 때문에
두배의 읽기 성능을 보여준다.
RAID-1 offers a performance advantage for reads: the RAID-1
driver uses distributed-read technology to simultaneously read
two sectors, one from each drive, thus doubling read performance.
RAID-5는 많은 것들을 포함하지만, 1997년 9월 현재 까지는,
데이터 디스크가 parity 디스크로 실제적으로 미러링되지는 않는다.
때문에 데이터를 병렬로 읽지는 않는다.
The RAID-5 driver, although it contains many optimizations, does not
currently (September 1997) realize that the parity disk is actually
a mirrored copy of the data disk. Thus, it serializes data reads.
- Q:
두개의 디스크가 망가졌을때에는 어떻게 대비하죠?
A:
몇몇의 RAID 는 알고리즘은 여러개의 디스크가 망가졌을 때를 대비할
수 있다. 하지만, 현재 리눅스에서 지원되지는 않는다.
그러나, RAID위에 RAID를 구축함으로써, Linux Software RAID로도,
그런 상황에 대비할 수 있다. 예를 들면,9개의 디스크로 3개의
RAID-5를 만들고 다시 그것을 하나의 RAID-5 로 만드는 것이다.
이런 설정은 3개의 디스크가 망가졌을때까지 대비할 수 있지만,
많은 공간이 ''낭비''된다는 것을 주목하라.
Some of the RAID algorithms do guard against multiple disk
failures, but these are not currently implemented for Linux.
However, the Linux Software RAID can guard against multiple
disk failures by layering an array on top of an array. For
example, nine disks can be used to create three raid-5 arrays.
Then these three arrays can in turn be hooked together into
a single RAID-5 array on top. In fact, this kind of a
configuration will guard against a three-disk failure. Note that
a large amount of disk space is ''wasted'' on the redundancy
information.
For an NxN raid-5 array,
N=3, 5 out of 9 disks are used for parity (=55%)
N=4, 7 out of 16 disks
N=5, 9 out of 25 disks
...
N=9, 17 out of 81 disks (=~20%)
일반적으로, MxN 개로 만들어진 RAID를 위해 M+N-1 개의
디스크가 parity 로 사용되고, M = N 일때 버려지는 양이
최소가 될 것이다.
In general, an MxN array will use M+N-1 disks for parity.
The least amount of space is "wasted" when M=N.
다른 방법은 세개의 디스크(RAID-5로 설정된)로 RAID-1을 만드는 것이다.
그것은, 세개의 디스크중 같은 데이터를 가지는 2/3을 낭비하게
될 것이다.
Another alternative is to create a RAID-1 array with
three disks. Note that since all three disks contain
identical data, that 2/3's of the space is ''wasted''.
- Q:
파티션이 제대로 unmount 되지 않았을 때
fsck가 실행되어서
파일시스템을 스스로 고치는 것이 어떻게 가능한지 알고 싶다.
RAID 시스템을 ckraid --fix 로 고칠수 있는데 왜 그것을
자동으로 하지 않는가?
I'd like to understand how it'd be possible to have something
like fsck: if the partition hasn't been cleanly unmounted,
fsck runs and fixes the filesystem by itself more than
90% of the time. Since the machine is capable of fixing it
by itself with ckraid --fix, why not make it automatic?
A:
/etc/rc.d/rc.sysinit 에 아래와 같이
추가함으로써 할수 있다.
This can be done by adding lines like the following to
/etc/rc.d/rc.sysinit:
mdadd /dev/md0 /dev/hda1 /dev/hdc1 || {
ckraid --fix /etc/raid.usr.conf
mdadd /dev/md0 /dev/hda1 /dev/hdc1
}
or
mdrun -p1 /dev/md0
if [ $? -gt 0 ] ; then
ckraid --fix /etc/raid1.conf
mdrun -p1 /dev/md0
fi
좀더 완벽한 스크립트를 만들기 이전에 시스템이 어떻게 켜지는지 보도록 하자.
Before presenting a more complete and reliable script,
lets review the theory of operation.
정상적으로 종료되지 않았다면, 리눅스는 아래와 같은 상태중의 하나일 꺼라고
Gadi Oxman은 말했다.
Gadi Oxman writes:
In an unclean shutdown, Linux might be in one of the following states:
|
|