본문 바로가기

IT인생_스크랩/Linux

centOS, mdadm raid5 복구 테스트

출처 : http://blog.naver.com/want813/90035756222


본인은 현재

/dev/md5 에 /dev/sda1, /dev/sdb1, /dev/sdc1, /dev/sdd1 을 사용중이며,

/dev/md5 를 /md5data 에 mount 해서 사용중이다.

 

/dev/sdc1 을 삭제해서 복구 테스트를 할 예정이다.

 

 

1. fail, remove disk

# umount /md5data ( 이 과정이 필요한지 아닌지.. 테스트 해보지 않았다 -_-;;)

# mdadm --manage /dev/md5 --fail /dev/sdc1 ( /dev/sdc1 을 faile 시킨다 )

# mdadm --detail /dev/md5

/dev/md5:

        Version : 00.90.03

  Creation Time : Thu Oct  2 20:58:52 2008

     Raid Level : raid5

     Array Size : 1465151808 (1397.28 GiB 1500.32 GB)

  Used Dev Size : 488383936 (465.76 GiB 500.11 GB)

   Raid Devices : 4

  Total Devices : 4

Preferred Minor : 5

    Persistence : Superblock is persistent

 

    Update Time : Mon Oct  6 11:23:04 2008

          State : clean, degraded

 Active Devices : 3

Working Devices : 3

 Failed Devices : 1

  Spare Devices : 0

 

         Layout : left-symmetric

     Chunk Size : 64K

 

           UUID : 0a75c94d:90e12dc2:17caabb6:a4c6ef14

         Events : 0.190

 

    Number   Major   Minor   RaidDevice State

       0       8        1        0      active sync   /dev/sda1

       1       8       17        1      active sync   /dev/sdb1

       3       8       49        3      active sync   /dev/sdd1

 

       4       8       33        -      faulty spare   /dev/sdc1

# cat /proc/mdstat

Personalities : [raid6] [raid5] [raid4]

md5 : active raid5 sdc1[4](F) sda1[0] sdd1[3] sdb1[1]

      1465151808 blocks level 5, 64k chunk, algorithm 2 [4/3] [UU_U]

     

unused devices: <none>

# mdadm --manage /dev/md5 --remove /dev/sdc1

mdadm: hot removed /dev/sdc1

# mdadm --detail /dev/md5

/dev/md5:

        Version : 00.90.03

  Creation Time : Thu Oct  2 20:58:52 2008

     Raid Level : raid5

     Array Size : 1465151808 (1397.28 GiB 1500.32 GB)

  Used Dev Size : 488383936 (465.76 GiB 500.11 GB)

   Raid Devices : 4

  Total Devices : 3

Preferred Minor : 5

    Persistence : Superblock is persistent

 

    Update Time : Mon Oct  6 11:27:08 2008

          State : clean, degraded

 Active Devices : 3

Working Devices : 3

 Failed Devices : 0

  Spare Devices : 0

 

         Layout : left-symmetric

     Chunk Size : 64K

 

           UUID : 0a75c94d:90e12dc2:17caabb6:a4c6ef14

         Events : 0.192

 

    Number   Major   Minor   RaidDevice State

       0       8        1        0      active sync   /dev/sda1

       1       8       17        1      active sync   /dev/sdb1

       2       0        0        2      removed

       3       8       49        3      active sync   /dev/sdd1

# cat /proc/mdstat

Personalities : [raid6] [raid5] [raid4]

md5 : active raid5 sda1[0] sdd1[3] sdb1[1]

      1465151808 blocks level 5, 64k chunk, algorithm 2 [4/3] [UU_U]

     

unused devices: <none>

# mount /dev/md5 /md5data

( application 이 잘 작동 되는지 확인 )

# reboot

 ................................................................................................................

# mdadm --manage /dev/md5 --add /dev/sdc1

mdadm: re-added /dev/sdc1

# mdadm --detail /dev/md5

/dev/md5:

        Version : 00.90.03

  Creation Time : Thu Oct  2 20:58:52 2008

     Raid Level : raid5

     Array Size : 1465151808 (1397.28 GiB 1500.32 GB)

  Used Dev Size : 488383936 (465.76 GiB 500.11 GB)

   Raid Devices : 4

  Total Devices : 4

Preferred Minor : 5

    Persistence : Superblock is persistent

 

    Update Time : Mon Oct  6 11:33:35 2008

          State : clean, degraded, recovering

 Active Devices : 3

Working Devices : 4

 Failed Devices : 0

  Spare Devices : 1

 

         Layout : left-symmetric

     Chunk Size : 64K

 

 Rebuild Status : 0% complete

 

           UUID : 0a75c94d:90e12dc2:17caabb6:a4c6ef14

         Events : 0.204

 

    Number   Major   Minor   RaidDevice State

       0       8        1        0      active sync   /dev/sda1

       1       8       17        1      active sync   /dev/sdb1

       4       8       33        2      spare rebuilding   /dev/sdc1

       3       8       49        3      active sync   /dev/sdd1

# cat /proc/mdstat

Personalities : [raid6] [raid5] [raid4]

md5 : active raid5 sdc1[4] sda1[0] sdd1[3] sdb1[1]

      1465151808 blocks level 5, 64k chunk, algorithm 2 [4/3] [UU_U]

      [>....................]  recovery =  0.3% (1895068/488383936) finish=174.5min speed=46460K/sec

     

unused devices: <none>

'IT인생_스크랩 > Linux' 카테고리의 다른 글

centOS5, mdadm 을 이용한 raid5 구성  (0) 2011.09.21
Linux mdadm man Page  (0) 2011.09.21
[linux]ssh-keygen(scp사용시 암호없이 사용)  (0) 2011.08.29
Linux rsync 사용법  (0) 2011.08.29
Time Server Operation (NTP)  (0) 2010.12.27