1. softraid 구성 확인
cat /proc/mdstat
Personalities : [raid1]
md3 : active raid1 sdb4[1] sda5[0]
4190208 blocks super 1.1 [2/2] [UU]
bitmap: 1/1 pages [4KB], 65536KB chunk
md0 : active raid1 sdb1[1] sda1[0]
511936 blocks super 1.0 [2/2] [UU]
md4 : active raid1 sdb5[1] sda6[0]
946754560 blocks super 1.1 [2/2] [UU]
bitmap: 5/8 pages [20KB], 65536KB chunk
md1 : active raid1 sdb2[1] sda2[0]
20955136 blocks super 1.1 [2/2] [UU]
bitmap: 1/1 pages [4KB], 65536KB chunk
md2 : active raid1 sdb3[1] sda3[0]
4190208 blocks super 1.1 [2/2] [UU]
2. 레이드 해지
mdadm /dev/md3 -f /dev/sdb5
mdadm /dev/md0 -f /dev/sdb1
mdadm /dev/md4 -f /dev/sdb6
mdadm /dev/md2 -f /dev/sdb3
mdadm /dev/md1 -f /dev/sdb2
md3 : active raid1 sda5[0] sdb5[1](F)
4190208 blocks super 1.1 [2/1] [U_]
bitmap: 1/1 pages [4KB], 65536KB chunk
md0 : active raid1 sda1[0] sdb1[1](F)
511936 blocks super 1.0 [2/1] [U_]
md4 : active raid1 sda6[0] sdb6[1](F)
946754560 blocks super 1.1 [2/1] [U_]
bitmap: 5/8 pages [20KB], 65536KB chunk
md2 : active raid1 sdb3[1](F) sda3[0]
4190208 blocks super 1.1 [2/1] [U_]
md1 : active raid1 sdb2[1](F) sda2[0]
20955136 blocks super 1.1 [2/1] [U_]
bitmap: 1/1 pages [4KB], 65536KB chunk
3. 레이드 삭제
mdadm /dev/md3 -r /dev/sdb5
mdadm /dev/md0 -r /dev/sdb1
mdadm /dev/md4 -r /dev/sdb6
mdadm /dev/md2 -r /dev/sdb3
mdadm /dev/md1 -r /dev/sdb2
Personalities : [raid1]
md3 : active raid1 sda5[0]
4190208 blocks super 1.1 [2/1] [U_]
bitmap: 1/1 pages [4KB], 65536KB chunk
md0 : active raid1 sda1[0]
511936 blocks super 1.0 [2/1] [U_]
md4 : active raid1 sda6[0]
946754560 blocks super 1.1 [2/1] [U_]
bitmap: 5/8 pages [20KB], 65536KB chunk
md2 : active raid1 sda3[0]
4190208 blocks super 1.1 [2/1] [U_]
md1 : active raid1 sda2[0]
20955136 blocks super 1.1 [2/1] [U_]
bitmap: 1/1 pages [4KB], 65536KB chunk
4. 서버 셧다운 및 디스크 교체
5. 서버 부팅
6. 파티션 정보 복사
sfdisk -d /dev/sda > sfdisk.sdb
sfdisk -f /dev/sdb < fdisk.sdb
sfdisk -d /dev/sda | sfdisk -f /dev/sdb
(sda -> sdb 쪽으로 복사)
2T 이상 (sgdisk)
2T 이하 (sfdisk)
7. 레이드 추가
mdadm /dev/md3 -a /dev/sdb5
mdadm /dev/md0 -a /dev/sdb1
mdadm /dev/md4 -a /dev/sdb6
mdadm /dev/md2 -a /dev/sdb3
mdadm /dev/md1 -a /dev/sdb2
8. 확인
cat /proc/mdstat
Personalities : [raid1]
md3 : active raid1 sdb5[2] sda5[0]
4190208 blocks super 1.1 [2/2] [UU]
bitmap: 1/1 pages [4KB], 65536KB chunk
md0 : active raid1 sdb1[2] sda1[0]
511936 blocks super 1.0 [2/2] [UU]
md4 : active raid1 sdb6[2] sda6[0]
946754560 blocks super 1.1 [2/1] [U_]
[====>................] recovery = 23.2% (220274048/946754560) finish=154.8min speed=78203K/sec
bitmap: 4/8 pages [16KB], 65536KB chunk
md1 : active raid1 sdb2[2] sda2[0]
20955136 blocks super 1.1 [2/1] [U_]
resync=DELAYED
bitmap: 1/1 pages [4KB], 65536KB chunk
md2 : active raid1 sdb3[2] sda3[0]
4190208 blocks super 1.1 [2/2] [UU]