다수의 디스크를 논리적인 하나의 디스크로 구성하여 데이터를 분산 저장하고 동시에 여러개를 읽어들이는 기능을 제공한다.
이를 통해서 데이터 저장/관리에 대한 신뢰성/안정성/이중성 보장, 성능/속도 향상이 가능하다
작업 대상 : /dev/sdc, /dev/sdd, /dev/sde, /dev/sdf, /dev/sdg
파티션 용량 : 전체
타입 : Raid 타입
일단 파티션 5개 raid 로 만들어주자..
순차적으로 저장
mdadm --create /dev/md0 --level=0 --raid-devices=3 /dev/sdc1 /dev/sdd1 /dev/sde1 -> 200 M 짜리 3개 raid 0 구성..
ls -l /dev/md0 ->
fdisk -l /dev/md0 -> Size 600 M
mdadm --detail --scan -v -> 장치 구성 정보
cat /proc/mdstat ->
mkfs -t ext4 /dev/md0 > /dev/null -> 파일시스템 포맷
mkdir /mnt/raid0
mount /dev/md0 /mnt/raid0 -> 마운트
df -h
umount /dev/md0 -> 마운트 해제
df -h | head -1 ; df -h | grep md0
rm -rf /mnt/raid0
mdadm --stop /dev/md0 -> raid stop
mdadm --zero-superblock /dev/sdc1 /dev/sdd1 /dev/sde1 -> 초기화
dadm --examine /dev/sdc1 /dev/sdd1 /dev/sde1 -> 초기화
ls -l /dev/md0
200M 2개를 raid1 로 구성 해서 200M 용량 사용가능.
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdf1 /dev/sdg1
ls -l /dev/md1
fdisk -l /dev/md1
mdadm --detail --scan -v
cat /proc/mdstat
mkfs -t ext4 /dev/md1 > /dev/null
mkdir /mnt/raid1
mount /dev/md1 /mnt/raid1
df -h
umount /dev/md1
df -h | head -1 ; df -h | grep md1
rm -rf /mnt/raid1
mdadm --stop /dev/md1
mdadm --zero-superblock /dev/sdf1 /dev/sdg1
mdadm --examine /dev/sdf1 /dev/sdg1
ls -l /dev/md1
Raid 4 구성 : /dev/sdc1(200M), /dev/sdd1(200M), /dev/sde1(200M)
2개의 disk는 raid0(RR)으로 나머지 1개는 패리티정보
disk 개수는 전체 - 1
패리티정보 디스크가 장애가 생길 시 복원이 쉽지 않음
mdadm --create /dev/md4 --level=4 --raid-devices=3 /dev/sdc1 /dev/sdd1
/dev/sde1
ls -l /dev/md4
fdisk -l /dev/md4
mdadm --detail --scan -v
cat /proc/mdstat
mkfs -t ext4 /dev/md4 > /dev/null
mkdir /mnt/raid4
mount /dev/md4 /mnt/raid4
df -h
umount /dev/md4
df -h
rm -rf /mnt/raid4
mdadm --stop /dev/md4
cat /proc/mdstat
mdadm --zero-superblock /dev/sdc1 /dev/sdd1 /dev/sde1
mdadm --examine /dev/sdc1 /dev/sdd1 /dev/sde1
ls -l /dev/md4
mdadm --create /dev/md5 --level=5 --raid-devices=3 /dev/sdc1 /dev/sdd1
/dev/sde1
ls -l /dev/md5
fdisk -l /dev/md5
mdadm --detail --scan -v
cat /proc/mdstat
mkfs -t ext4 /dev/md5 > /dev/null
mkdir /mnt/raid5
mount /dev/md5 /mnt/raid5
df -h
umount /dev/md5
df -h
rm -rf /mnt/raid5
mdadm --stop /dev/md5
cat /proc/mdstat
mdadm --zero-superblock /dev/sdc1 /dev/sdd1 /dev/sde1
mdadm --examine /dev/sdc1 /dev/sdd1 /dev/sde1
ls -l /dev/md5
mdadm --create /dev/md6 --level=6 --raid-devices=5 /dev/sdc1 /dev/sdd1
/dev/sde1 /dev/sdf1 /dev/sdg1
ls -l /dev/md6
fdisk -l /dev/md6
mdadm --detail --scan -v
cat /proc/mdstat
mkfs -t ext4 /dev/md6 > /dev/null
mkdir /mnt/raid6
mount /dev/md6 /mnt/raid6
df -h
umount /dev/md6
df -h
rm -rf /mnt/raid6
mdadm --stop /dev/md6
cat /proc/mdstat
mdadm --zero-superblock /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1
mdadm --examine /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1
ls -l /dev/md6
mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sdc1 /dev/sdd1
mdadm --create /dev/md1 --level=0 --raid-devices=2 /dev/sde1 /dev/sdf1
mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/md0 /dev/md1
ls -l /dev/md2
fdisk -l /dev/md2
mdadm --detail --scan -v
cat /proc/mdstat
mkfs -t ext4 /dev/md2 > /dev/null
mkdir /mnt/raid01
mount /dev/md2 /mnt/raid01
df -h
umount /dev/md2
df -h
rm -rf /mnt/raid01
mdadm --stop /dev/md2
cat /proc/mdstat
mdadm --zero-superblock /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1
mdadm --examine /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1
ls -l /dev/md2
ls -l /dev/md1
ls -l /dev/md0
mdadm --create /dev/md10 --level=10 --raid-devices=4 /dev/sdc1 /dev/sdd1
/dev/sde1 /dev/sdf1
ls -l /dev/md10
fdisk -l /dev/md10
mdadm --detail --scan -v
cat /proc/mdstat
mkfs -t ext4 /dev/md10 > /dev/null
mkdir /mnt/raid10
mount /dev/md10 /mnt/raid10
df -h
umount /dev/md10
df -h
rm -rf /mnt/raid10
mdadm --stop /dev/md10
cat /proc/mdstat
mdadm --zero-superblock /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1
mdadm --examine /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1
ls -l /dev/md10