'mdadm'에 해당하는 글 2건

[root@mail ~]# mdadm --detail --scan
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=0.90 UUID=xxx
ARRAY /dev/md4 level=raid1 num-devices=2 metadata=0.90 UUID=xxx
ARRAY /dev/md2 level=raid1 num-devices=2 metadata=0.90 UUID=xxx
ARRAY /dev/md3 level=raid1 num-devices=2 metadata=0.90 UUID=xxx
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=xxx

새로 추가된 부분이 있다면 위에서 조회한것중 아래 파일에서 없다면 복사하여 붙여 넣기 하면 된다.

/etc/mdadm.conf


신고

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
os: centos5.4


SATA 1T ( /dev/sdb1 ) , SATA 1T (/dev/sdc1) raid1로 구성하기

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes




1 . 파일시스템 fd : Linux raid autodetect 로 잡는다.


# fdisk /dev/sdb

The number of cylinders for this disk is set to 121601.
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/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 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-121601, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601):
Using default value 121601

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): l

 0  Empty           1e  Hidden W95 FAT1 80  Old Minix       bf  Solaris
 1  FAT12           24  NEC DOS         81  Minix / old Lin c1  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          82  Linux swap / So c4  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  83  Linux           c6  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     84  OS/2 hidden C:  c7  Syrinx
 5  Extended        41  PPC PReP Boot   85  Linux extended  da  Non-FS data
 6  FAT16           42  SFS             86  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS       4d  QNX4.x          87  NTFS volume set de  Dell Utility
 8  AIX             4e  QNX4.x 2nd part 88  Linux plaintext df  BootIt
 9  AIX bootable    4f  QNX4.x 3rd part 8e  Linux LVM       e1  DOS access
 a  OS/2 Boot Manag 50  OnTrack DM      93  Amoeba          e3  DOS R/O
 b  W95 FAT32       51  OnTrack DM6 Aux 94  Amoeba BBT      e4  SpeedStor
 c  W95 FAT32 (LBA) 52  CP/M            9f  BSD/OS          eb  BeOS fs
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi ee  EFI GPT
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a5  FreeBSD         ef  EFI (FAT-12/16/
10  OPUS            55  EZ-Drive        a6  OpenBSD         f0  Linux/PA-RISC b
11  Hidden FAT12    56  Golden Bow      a7  NeXTSTEP        f1  SpeedStor
12  Compaq diagnost 5c  Priam Edisk     a8  Darwin UFS      f4  SpeedStor
14  Hidden FAT16 <3 61  SpeedStor       a9  NetBSD          f2  DOS secondary
16  Hidden FAT16    63  GNU HURD or Sys ab  Darwin boot     fb  VMware VMFS
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT
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/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      121601   976760001   fd  Linux raid autodetect

/dev/sdc1 도 동일하게 진행합니다.

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      121601   976760001   fd  Linux raid autodetect


2. mknod /dev/md1 b 9 1

3. mdadm 명령어를 이용해 raid1 구성을 합니다.

# mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm: size set to 976759936K
mdadm: array /dev/md1 started.

4. 레이드 묶는거 확인하기

watch -n1 'cat /proc/mdstat'

# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdc1[1] sdb1[0]
      976759936 blocks [2/2] [UU]
      [>....................]  resync =  0.2% (2698112/976759936) finish=270.3min speed=60042K/sec
     
unused devices: <none>


완료되면 마운트하기 위해 mkfs -j /dev/md1

mkdir /data

mount /dev/md1 /data




### 운영 팁 ###

* 실제 올리기

mdadm --assemble /dev/md1 /dev/sdc1 /dev/sdd1

* 중지

mdadm --stop /dev/md1




하드가 1개 에러가 나서 mdstat 에서 _U 1개만 서비스될때

mdadm /dev/md1 -r /dev/sdd1

fsck /dev/sdd1

mdadm /dev/md1 -a /dev/sdd1
 
---> 여기서는 파일시스템을 체킹했지만, 문제가 발견되었다면 새 하드로 교체합니다.


[root@mail ~]# mdadm --detail --scan
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=0.90 UUID=xxx
ARRAY /dev/md4 level=raid1 num-devices=2 metadata=0.90 UUID=xxx
ARRAY /dev/md2 level=raid1 num-devices=2 metadata=0.90 UUID=xxx
ARRAY /dev/md3 level=raid1 num-devices=2 metadata=0.90 UUID=xxx
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=xxx

새로 추가된 부분이 있다면 위에서 조회한것중 아래 파일에서 없다면 복사하여 붙여 넣기 하면 된다.

/etc/mdadm.conf



신고

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

받은 트랙백이 없고 , 댓글 하나 달렸습니다.
  1. 하드가 1개 에러가 나서 mdstat 에서 _U 1개만 서비스될때

    mdadm /dev/md1 -r /dev/sdd1

    fsck /dev/sdd1

    mdadm /dev/md1 -a /dev/sdd1


    ^^
secret