설명 : 장애 시나리오는 RAID1 에서의 DISK FAIL


* 정상 Mirroring 상태에서의 메시지

# mdadm --detail --scan
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=615e01d3:3ccde595:30147acb:17dbc2e2
   devices=/dev/sdd1,/dev/sde1


* Mirroring 디스크 중 /dev/sde1의 Fail 시 메시지

# mdadm --detail --scan
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=615e01d3:3ccde595:30147acb:17dbc2e2
   devices=/dev/sdd1


* 복구 과정

1. 서버를 셧다운 시킨 후 Fail 된 디스크 교체 후 부팅 시킴


2. Fdisk 작업 수행

# fdisk /dev/sde

The number of cylinders for this disk is set to 4462.
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): n
Command action
   e   extended
   p   primary partition (1-4) p
Partition number (1-4): 1
First cylinder (1-4462, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-4462, default 4462):
Using default value 4462

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): p

Disk /dev/sde: 36.7 GB, 36703918080 bytes
255 heads, 63 sectors/track, 4462 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1        4462    35840983+  fd  Linux raid autodetect

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


 

3. /dev/md1에 새로운 디스크 추가

# mdadm /dev/md1 --add /dev/sde1

mdadm: hot added /dev/sde1


 위 명령어는 RAID 장치에 /dev/sde1을 추가하는 명령어다.

 여기서 새로 추가한 디스크가 /dev/sdf1이라면 다음과 같은 명령어로 사용할 수도 있다.

# mdadm /dev/md1 --add /dev/sdf1



4. /dev/md1 정상 동작 확인

# mdadm --detail --scan



신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret