Raid

mdadm 2x Raid 5 缺少驅動器

  • July 15, 2016

我希望有人可以引導我解決重建/同步問題。我在每個 md0(活動,已降級)、md1(活動、已降級)和 md2(乾淨)中有 3 個 RAID 5 建構在 mdadm 4 磁碟中 - 沒有數據,所以我不在乎。

所有 12 個驅動器都連接到 LSI 9750-8i 卡。潛水都作為單一的“單位”附加到這張卡上。一個驅動器出現故障並顯示為 LSI 3dm2 介面缺失。在 Mdadm 中,陣列還將驅動器顯示為“已刪除”。

更複雜的是,第二個陣列也顯示為活動,隨著潛水“移除”而降級

我已關閉系統並用另一個新驅動器替換了故障的 3TB 驅動器。由於我知道發生故障之前存在哪些驅動器,因此我知道哪兩個驅動器不再屬於陣列。sdh = 已跳出陣列之一的驅動器。sd0 = 已安裝的新物理驅動器。超級塊是持久的。

問題 #1。我可以查詢潛水的序列號,但我似乎無法找出 sdh 最初屬於哪個陣列,希望我可以將其添加回正確的陣列。

問題 #2。根據 sdf 屬於哪一個,將 sdo 添加到 md’x’ 數組中。

在 LSI 3dm2 中報告了一些物理驅動器錯誤,但重新掃描後這些錯誤消失了,並且此級別的所有驅動器現在都報告“正常”。但是,這可能是 sdf 最初從陣列中“掉出”的問題的一部分?

我假設,我必須使用 gpart 格式化 3TB 驅動器,然後將其添加到另一個陣列?我有備份,這是生產 NAS。我寧願不破解它而犯錯誤導致重建……

如果有人可以就如何進行它提出一些建議,那就太好了!TIA

從貓 /proc

 [root@pithos dev]# cat /proc/mdstat   Personalities : [raid6] [raid5 [raid4]
  md0 : active raid5 sdc1[0] sdd1[4] sde1[2]
       8789025216 blocks super 1.2 level 5, 64k chunk, algorithm 2 [4/3] [U_UU]

  md1 : active raid5 sdf1[0] sdi1[4] sdg1[1]
      8789025216 blocks super 1.2 level 5, 64k chunk, algorithm 2 [4/3] [UU_U]

  md2 : active raid5 sdj1[0] sdm1[4] sdl1[2] sdk1[1]
      8789025216 blocks super 1.2 level 5, 64k chunk, algorithm 2 [4/4] [UUUU]

unused devices: <none>

Md0

[root@pithos dev]# mdadm --detail /dev/md0
/dev/md0:
       Version : 1.2
 Creation Time : Fri May 31 10:46:54 2013
    Raid Level : raid5
    Array Size : 8789025216 (8381.87 GiB 8999.96 GB)
 Used Dev Size : 2929675072 (2793.96 GiB 2999.99 GB)
  Raid Devices : 4
 Total Devices : 3
   Persistence : Superblock is persistent

   Update Time : Fri Jul  8 18:07:27 2016
         State : active, degraded
Active Devices : 3
Working Devices : 3
Failed Devices : 0
 Spare Devices : 0

        Layout : left-symmetric
    Chunk Size : 64K

          Name : pithos.dougallmedia.com:0  (local to host pithos.dougallmedia.com)
          UUID : f1e42a86:7fc791f8:7cf63ab8:065ffa92
        Events : 3543

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

MD1

[root@pithos dev]# mdadm -D /dev/md1
/dev/md1:
       Version : 1.2
 Creation Time : Fri May 31 17:44:49 2013
    Raid Level : raid5
    Array Size : 8789025216 (8381.87 GiB 8999.96 GB)
 Used Dev Size : 2929675072 (2793.96 GiB 2999.99 GB)
  Raid Devices : 4
 Total Devices : 3
   Persistence : Superblock is persistent

   Update Time : Tue Jul 12 11:31:52 2016
         State : clean, degraded
Active Devices : 3
Working Devices : 3
Failed Devices : 0
 Spare Devices : 0

        Layout : left-symmetric
    Chunk Size : 64K

          Name : pithos.dougallmedia.com:1  (local to host pithos.dougallmedia.com)
          UUID : 58ba8949:bed7be0b:ba4dcc3e:8e6bc5e2
        Events : 9779

   Number   Major   Minor   RaidDevice State
      0       8       81        0      active sync   /dev/sdf1
      1       8       97        1      active sync   /dev/sdg1
      2       0        0        2      removed
      4       8      129        3      active sync   /dev/sdi1


[root@pithos dev]# mdadm --assemble --scan -v
mdadm: looking for devices for /dev/md2
mdadm: Cannot assemble mbr metadata on /dev/sdo
mdadm: cannot open device /dev/dm-10: Device or resource busy
mdadm: cannot open device /dev/dm-9: Device or resource busy
mdadm: cannot open device /dev/dm-8: Device or resource busy
mdadm: cannot open device /dev/dm-7: Device or resource busy
mdadm: cannot open device /dev/dm-6: Device or resource busy
mdadm: cannot open device /dev/dm-5: Device or resource busy
mdadm: cannot open device /dev/md0: Device or resource busy
mdadm: cannot open device /dev/md1: Device or resource busy
mdadm: no recogniseable superblock on /dev/md2
mdadm: Cannot assemble mbr metadata on /dev/sdn
mdadm: cannot open device /dev/dm-4: Device or resource busy
mdadm: cannot open device /dev/dm-3: Device or resource busy
mdadm: cannot open device /dev/dm-2: Device or resource busy
mdadm: cannot open device /dev/dm-1: Device or resource busy
mdadm: cannot open device /dev/dm-0: Device or resource busy
mdadm: cannot open device /dev/sdk1: Device or resource busy
mdadm: cannot open device /dev/sdk: Device or resource busy
mdadm: cannot open device /dev/sdm1: Device or resource busy
mdadm: cannot open device /dev/sdm: Device or resource busy
mdadm: cannot open device /dev/sdl1: Device or resource busy
mdadm: cannot open device /dev/sdl: Device or resource busy
mdadm: cannot open device /dev/sdj1: Device or resource busy
mdadm: cannot open device /dev/sdj: Device or resource busy
mdadm: cannot open device /dev/sdg1: Device or resource busy
mdadm: cannot open device /dev/sdg: Device or resource busy
mdadm: cannot open device /dev/sdi1: Device or resource busy
mdadm: cannot open device /dev/sdi: Device or resource busy
mdadm: /dev/sdh1 has wrong uuid.
mdadm: Cannot assemble mbr metadata on /dev/sdh
mdadm: cannot open device /dev/sdd1: Device or resource busy
mdadm: cannot open device /dev/sdd: Device or resource busy
mdadm: cannot open device /dev/sde1: Device or resource busy
mdadm: cannot open device /dev/sde: Device or resource busy
mdadm: cannot open device /dev/sdf1: Device or resource busy
mdadm: cannot open device /dev/sdf: Device or resource busy
mdadm: cannot open device /dev/sdc1: Device or resource busy
mdadm: cannot open device /dev/sdc: Device or resource busy
mdadm: cannot open device /dev/sdb: Device or resource busy
mdadm: cannot open device /dev/sda: Device or resource busy
mdadm: looking for devices for /dev/md1
mdadm: Cannot assemble mbr metadata on /dev/sdo
mdadm: cannot open device /dev/dm-10: Device or resource busy
mdadm: cannot open device /dev/dm-9: Device or resource busy
mdadm: cannot open device /dev/dm-8: Device or resource busy
mdadm: cannot open device /dev/dm-7: Device or resource busy
mdadm: cannot open device /dev/dm-6: Device or resource busy
mdadm: cannot open device /dev/dm-5: Device or resource busy
mdadm: cannot open device /dev/md0: Device or resource busy
mdadm: cannot open device /dev/md1: Device or resource busy
mdadm: no recogniseable superblock on /dev/md2
mdadm: Cannot assemble mbr metadata on /dev/sdn
mdadm: cannot open device /dev/dm-4: Device or resource busy
mdadm: cannot open device /dev/dm-3: Device or resource busy
mdadm: cannot open device /dev/dm-2: Device or resource busy
mdadm: cannot open device /dev/dm-1: Device or resource busy
mdadm: cannot open device /dev/dm-0: Device or resource busy
mdadm: cannot open device /dev/sdk1: Device or resource busy
mdadm: cannot open device /dev/sdk: Device or resource busy
mdadm: cannot open device /dev/sdm1: Device or resource busy
mdadm: cannot open device /dev/sdm: Device or resource busy
mdadm: cannot open device /dev/sdl1: Device or resource busy
mdadm: cannot open device /dev/sdl: Device or resource busy
mdadm: cannot open device /dev/sdj1: Device or resource busy
mdadm: cannot open device /dev/sdj: Device or resource busy
mdadm: cannot open device /dev/sdg1: Device or resource busy
mdadm: cannot open device /dev/sdg: Device or resource busy
mdadm: cannot open device /dev/sdi1: Device or resource busy
mdadm: cannot open device /dev/sdi: Device or resource busy
mdadm: /dev/sdh1 has wrong uuid.
mdadm: Cannot assemble mbr metadata on /dev/sdh
mdadm: cannot open device /dev/sdd1: Device or resource busy
mdadm: cannot open device /dev/sdd: Device or resource busy
mdadm: cannot open device /dev/sde1: Device or resource busy
mdadm: cannot open device /dev/sde: Device or resource busy
mdadm: cannot open device /dev/sdf1: Device or resource busy
mdadm: cannot open device /dev/sdf: Device or resource busy
mdadm: cannot open device /dev/sdc1: Device or resource busy
mdadm: cannot open device /dev/sdc: Device or resource busy
mdadm: cannot open device /dev/sdb: Device or resource busy
mdadm: cannot open device /dev/sda: Device or resource busy
mdadm: looking for devices for /dev/md0
mdadm: Cannot assemble mbr metadata on /dev/sdo
mdadm: cannot open device /dev/dm-10: Device or resource busy
mdadm: cannot open device /dev/dm-9: Device or resource busy
mdadm: cannot open device /dev/dm-8: Device or resource busy
mdadm: cannot open device /dev/dm-7: Device or resource busy
mdadm: cannot open device /dev/dm-6: Device or resource busy
mdadm: cannot open device /dev/dm-5: Device or resource busy
mdadm: cannot open device /dev/md0: Device or resource busy
mdadm: cannot open device /dev/md1: Device or resource busy
mdadm: no recogniseable superblock on /dev/md2
mdadm: Cannot assemble mbr metadata on /dev/sdn
mdadm: cannot open device /dev/dm-4: Device or resource busy
mdadm: cannot open device /dev/dm-3: Device or resource busy
mdadm: cannot open device /dev/dm-2: Device or resource busy
mdadm: cannot open device /dev/dm-1: Device or resource busy
mdadm: cannot open device /dev/dm-0: Device or resource busy
mdadm: cannot open device /dev/sdk1: Device or resource busy
mdadm: cannot open device /dev/sdk: Device or resource busy
mdadm: cannot open device /dev/sdm1: Device or resource busy
mdadm: cannot open device /dev/sdm: Device or resource busy
mdadm: cannot open device /dev/sdl1: Device or resource busy
mdadm: cannot open device /dev/sdl: Device or resource busy
mdadm: cannot open device /dev/sdj1: Device or resource busy
mdadm: cannot open device /dev/sdj: Device or resource busy
mdadm: cannot open device /dev/sdg1: Device or resource busy
mdadm: cannot open device /dev/sdg: Device or resource busy
mdadm: cannot open device /dev/sdi1: Device or resource busy
mdadm: cannot open device /dev/sdi: Device or resource busy
mdadm: no recogniseable superblock on /dev/sdh1
mdadm: Cannot assemble mbr metadata on /dev/sdh
mdadm: cannot open device /dev/sdd1: Device or resource busy
mdadm: cannot open device /dev/sdd: Device or resource busy
mdadm: cannot open device /dev/sde1: Device or resource busy
mdadm: cannot open device /dev/sde: Device or resource busy
mdadm: cannot open device /dev/sdf1: Device or resource busy
mdadm: cannot open device /dev/sdf: Device or resource busy
mdadm: cannot open device /dev/sdc1: Device or resource busy
mdadm: cannot open device /dev/sdc: Device or resource busy
mdadm: cannot open device /dev/sdb: Device or resource busy
mdadm: cannot open device /dev/sda: Device or resource busy

問題 #1。我可以查詢潛水的序列號,但我似乎無法找出 sdh 最初屬於哪個陣列,希望我可以將其添加回正確的陣列。

使用mdadm -E /dev/sdh1(檢查)。然後你可以使用mdadm --re-add ...or --add

此外,如果您的其他磁碟執行狀況良好,即使它已經有數據,您也可以簡單地重建該磁碟。

如果這不起作用,您可能不得不mdadm --create --assume-clean ...在舊數據之上創建一個新數組,重用數據,這是危險的。請務必保存您的詳細資訊 ( -D) 並首先檢查所有磁碟的輸出。您必須明確設置在檢查或詳細輸出中看到的許多內容,例如佈局、級別、驅動順序、塊大小等。為了--create安全使用,請務必使用疊加層進行良好測試,而不是冒險使用您的數據。使用--assume-clean意味著它將保留您的舊數據。

問題 #2。根據 sdf 屬於哪一個,將 sdo 添加到 md’x’ 數組中。

您可以在mdadm -E知道要將其添加到哪個數組之後執行此步驟,即使您沒有完成疊加,也只是mdadm --add /dev/md0 /dev/sdo

而且我還建議您經常在磁碟上執行智能長時間測試,這樣您就可以在磁碟導致 RAID 問題之前更換磁碟。(此外,Seagate Barracuda 3TB 磁碟非常不可靠……我猜這就是你所擁有的,這不是 mdadm 的錯;添加智能測試也有助於解決這些類型的問題。)

我建議您訪問 irc.freenode.net #linux-raid 以獲得解決此類問題的最佳實時幫助。

引用自:https://unix.stackexchange.com/questions/295481