Ubuntu

ubuntu 10.04 上的 mdadm - 4 個磁碟的 raid5,重新啟動後缺少一個磁碟

  • May 25, 2011

我在伺服器(Ubuntu 10.04)中的 RAID 陣列有問題。

我有一個 4 個磁碟的 raid5 陣列 - sd

$$ cdef $$,創建如下:

# partition disks
parted /dev/sdc mklabel gpt
parted /dev/sdc mkpart primary ext2 1 2000GB
parted /dev/sdc set 1 raid on
# create array
mdadm --create -v --level=raid5 /dev/md2 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1

這已經執行了幾個月。

我剛剛應用了系統更新並重新啟動,raid5 - /dev/md2- 沒有在啟動時恢復。當我用 重新組裝它時mdadm --assemble --scan,它似乎只提供了 3 個成員驅動器 - 缺少 sdf1。這是我能找到的:

(旁注:md0 和 md1 是在幾個驅動器上建構的 raid-1,分別用於 / 和交換。)

root@dwight:~# mdadm --query --detail /dev/md2
/dev/md2:
       Version : 00.90
 Creation Time : Sun Feb 20 23:52:28 2011
    Raid Level : raid5
    Array Size : 5860540224 (5589.05 GiB 6001.19 GB)
 Used Dev Size : 1953513408 (1863.02 GiB 2000.40 GB)
  Raid Devices : 4
 Total Devices : 3
Preferred Minor : 2
   Persistence : Superblock is persistent

   Update Time : Fri Apr  8 22:10:38 2011
         State : clean, degraded
Active Devices : 3
Working Devices : 3
Failed Devices : 0
 Spare Devices : 0

        Layout : left-symmetric
    Chunk Size : 64K

          UUID : 1bb282b6:fe549071:3bf6c10c:6278edbc (local to host dwight)
        Events : 0.140

   Number   Major   Minor   RaidDevice State
      0       8       33        0      active sync   /dev/sdc1
      1       8       49        1      active sync   /dev/sdd1
      2       8       65        2      active sync   /dev/sde1
      3       0        0        3      removed

(是的,伺服器叫 Dwight;我是 The Office 的粉絲 :))

所以它認為缺少一個驅動器(實際上是分區),/dev/sdf1。

root@dwight:~# mdadm --detail --scan
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=00.90 UUID=c7dbadaa:7762dbf7:beb6b904:6d3aed07
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=00.90 UUID=1784e912:d84242db:3bf6c10c:6278edbc
mdadm: md device /dev/md/d2 does not appear to be active.
ARRAY /dev/md2 level=raid5 num-devices=4 metadata=00.90 UUID=1bb282b6:fe549071:3bf6c10c:6278edbc

什麼,什麼,/dev/md/d2?/dev/md/d2 是什麼?我沒有創造那個。

root@dwight:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md2 : active raid5 sdc1[0] sde1[2] sdd1[1]
     5860540224 blocks level 5, 64k chunk, algorithm 2 [4/3] [UUU_]

md_d2 : inactive sdf1[3](S)
     1953513408 blocks

md1 : active raid1 sdb2[1] sda2[0]
     18657728 blocks [2/2] [UU]

md0 : active raid1 sdb1[1] sda1[0]
     469725120 blocks [2/2] [UU]

unused devices: <none>

同上。md_d2? sd

$$ cde $$1 在 md2 中正確,但 sdf1 失去(似乎認為它應該是一個自己的數組?)

root@dwight:~# mdadm -v --examine /dev/sdf1
/dev/sdf1:
         Magic : a92b4efc
       Version : 00.90.00
          UUID : 1bb282b6:fe549071:3bf6c10c:6278edbc (local to host dwight)
 Creation Time : Sun Feb 20 23:52:28 2011
    Raid Level : raid5
 Used Dev Size : 1953513408 (1863.02 GiB 2000.40 GB)
    Array Size : 5860540224 (5589.05 GiB 6001.19 GB)
  Raid Devices : 4
 Total Devices : 4
Preferred Minor : 2

   Update Time : Fri Apr  8 21:40:42 2011
         State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
 Spare Devices : 0
      Checksum : 71136469 - correct
        Events : 114

        Layout : left-symmetric
    Chunk Size : 64K

     Number   Major   Minor   RaidDevice State
this     3       8       81        3      active sync   /dev/sdf1

  0     0       8       33        0      active sync   /dev/sdc1
  1     1       8       49        1      active sync   /dev/sdd1
  2     2       8       65        2      active sync   /dev/sde1
  3     3       8       81        3      active sync   /dev/sdf1

…所以 sdf1 認為它是 md2 設備的一部分,對嗎?

當我在 /dev/sdc1 上執行它時,我得到:

root@dwight:~# mdadm -v --examine /dev/sdc1
/dev/sdc1:
         Magic : a92b4efc
       Version : 00.90.00
          UUID : 1bb282b6:fe549071:3bf6c10c:6278edbc (local to host dwight)
 Creation Time : Sun Feb 20 23:52:28 2011
    Raid Level : raid5
 Used Dev Size : 1953513408 (1863.02 GiB 2000.40 GB)
    Array Size : 5860540224 (5589.05 GiB 6001.19 GB)
  Raid Devices : 4
 Total Devices : 3
Preferred Minor : 2

   Update Time : Fri Apr  8 22:50:03 2011
         State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 1
 Spare Devices : 0
      Checksum : 71137458 - correct
        Events : 144

        Layout : left-symmetric
    Chunk Size : 64K

     Number   Major   Minor   RaidDevice State
this     0       8       33        0      active sync   /dev/sdc1

  0     0       8       33        0      active sync   /dev/sdc1
  1     1       8       49        1      active sync   /dev/sdd1
  2     2       8       65        2      active sync   /dev/sde1
  3     3       0        0        3      faulty removed

當我嘗試將 sdf1 添加回 /dev/md2 數組時,我收到一個繁忙的錯誤:

root@dwight:~# mdadm --add /dev/md2 /dev/sdf1
mdadm: Cannot open /dev/sdf1: Device or resource busy

幫助!如何將 sdf1 添加回 md2 數組?

謝謝,

mdadm -S /dev/md_d2,然後嘗試添加 sdf1.

引用自:https://serverfault.com/questions/257356