레드햇 리눅스 소프트웨어 RAID 구성하기
**) 이 문서는 레드햇 엔터프라이즈 클론인 CentOS 4.4 버전에서 시험하였음.
**) 같은 모델의 300GB IDE 하드가 2개고 RAID-0 타입으로 구성한다는 가정하에 작성함.
**) 시험할 하드디스크는 /dev/hda와 /dev/hdb
**) 시스템이 설치된 하드디스크는 따로 있음. (/dev/sda)
1. fdisk를 사용하여 두 하드디스크의 파티션을 아래와 같이 raid auto(fd) 타입으로 잡는다.
# fdisk /dev/hda
The number of cylinders for this disk is set to 36481.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/hda: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 36481 293033601 83 Linux
Command (m for help): d
Selected partition 1
Command (m for help): p
Disk /dev/hda: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-36481, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-36481, default 36481):
Using default value 36481
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): fd <-- 여기서 fd로 입력한다.
Changed system type of partition 1 to fd (Linux raid autodetect)
Command (m for help): p
Disk /dev/hda: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 36481 293033601 fd Linux raid autodetect
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
#
2. (1)과 같은 방법으로 /dev/hdb도 파티션을 잡아준다.
3. 아래와 같이 하여 RAID를 구성해 준다.
# mdadm -C /dev/md0 --level=raid0 --raid-devices=2 /dev/hda1 /dev/hdb1
mdadm: /dev/hda1 appears to contain an ext2fs file system
size=586067072K mtime=Fri Dec 1 14:37:24 2006
mdadm: /dev/hda1 appears to be part of a raid array:
level=0 devices=2 ctime=Fri Dec 1 14:30:43 2006
mdadm: /dev/hdb1 appears to be part of a raid array:
level=0 devices=2 ctime=Fri Dec 1 14:30:43 2006
Continue creating array? y <-- 여기서 y를 입력한다.
mdadm: array /dev/md0 started.
#
4. 아래와 같이 마운트를 테스트 한다.
# mount -t ext3 -o usrquota,grpquota,noatime /dev/md0 /home
5. fstab를 편집해 준다. 이때 주의할 점은 LABEL로 되어 있는 다른 장치명들을
/dev/... 형식으로 변경해 준다.
6. 끝.