ubuntu에서 4개의 HDD를 raid 구성
- 먼저 raid 구성을 위한 패키지를 설치한다
sudo apt install mdadm
- 디스크 확인
fdisk -l
Disk /dev/sda: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: WCD WD30EFRX-68E
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sdb: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: WCD WD30EFRX-68E
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sdc: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: WCD WD30EFRX-68E
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sdd: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: WCD WD30EFRX-68E
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
- RAID 5 배열 생성
sudo mdadm --create /dev/md0 --level=5 --raid-devices=4 /dev/sda /dev/sdb /dev/sdc /dev/sdd
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
- RAID 상태 확인
sudo mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Fri Mar 28 02:45:31 2025
Raid Level : raid5
Array Size : 8790402048 (8.19 TiB 9.00 TB)
Used Dev Size : 2930134016 (2.73 TiB 3.00 TB)
Raid Devices : 4
Total Devices : 4
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Fri Mar 28 02:46:33 2025
State : clean, degraded, recovering
Active Devices : 3
Working Devices : 4
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 512K
Consistency Policy : bitmap
Rebuild Status : 0% complete
Name : vtopia-WTR-PRO:0 (local to host vtopia-WTR-PRO)
UUID : a2f3346c:8a06955e:5045941c:82faed59
Events : 13
Number Major Minor RaidDevice State
0 8 0 0 active sync /dev/sda
1 8 16 1 active sync /dev/sdb
2 8 32 2 active sync /dev/sdc
4 8 48 3 spare rebuilding /dev/sdd
vtopia@vtopia-WTR-PRO:~$
- 파티션 생성
sudo mdadm --detail /dev/md0
다소 시간이 걸린다
- 마운트
sudo mkdir /hdd
sudo mount /dev/md0 /hdd
- 마운트 확인
df -h

- 자동 마운트 설정
아래 명령어로 UUID 파악
sudo blkid /dev/md0
아래 명령으로 부팅 시 자동 마운트 되게 설정
sudo nano /etc/fstab
# 아래 내용 추가
UUID=<your-uuid> /mnt/raid ext4 defaults 0 2