2013-06-04 08:15:37 +0000 2013-06-04 08:15:37 +0000
22
22
Advertisement

Come posso riattivare il mio array MDADM RAID5?

Advertisement

Ho appena cambiato casa, il che ha comportato lo smantellamento del mio server e il suo ricollegamento. Da quando l'ho fatto, uno dei miei array MDADM RAID5 appare inattivo:

root@mserver:/tmp# cat /proc/mdstat 
Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10] 
md1 : active raid5 sdc1[1] sdh1[2] sdg1[0]
      3907023872 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]

md0 : inactive sdd1[0](S) sdf1[3](S) sde1[2](S) sdb1[1](S)
      3907039744 blocks

unused devices: <none>

Mi sembra che abbia trovato tutti i dischi ma per qualche ragione non vuole usarli.

Quindi cosa significano le etichette (S) e come posso dire a MDADM di iniziare a usare di nuovo l'array?

[Edit] Ho appena provato a fermare e montare l'array con -v:

root@mserver:~# mdadm --stop /dev/md0
mdadm: stopped /dev/md0

root@mserver:~# mdadm --assemble --scan -v
mdadm: /dev/sde1 is identified as a member of /dev/md0, slot 2.
mdadm: /dev/sdf1 is identified as a member of /dev/md0, slot 3.
mdadm: /dev/sdd1 is identified as a member of /dev/md0, slot 0.
mdadm: /dev/sdb1 is identified as a member of /dev/md0, slot 1.
mdadm: added /dev/sdd1 to /dev/md0 as 0 (possibly out of date)
mdadm: added /dev/sdb1 to /dev/md0 as 1 (possibly out of date)
mdadm: added /dev/sdf1 to /dev/md0 as 3 (possibly out of date)
mdadm: added /dev/sde1 to /dev/md0 as 2
mdadm: /dev/md0 assembled from 1 drive - not enough to start the array.

..e inserendo cat /proc/mdstat non sembra diverso.

[Edit2] Non so se aiuta ma questo è il risultato dell'esame di ogni disco:

root@mserver:~# mdadm –examine /dev/sdb1

/dev/sdb1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 2f331560:fc85feff:5457a8c1:6e047c67 (local to host mserver)
  Creation Time : Sun Feb 1 20:53:39 2009
     Raid Level : raid5
  Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
     Array Size : 2930279808 (2794.53 GiB 3000.61 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0

    Update Time : Sat Apr 20 13:22:27 2013
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 6c8f71a3 - correct
         Events : 955190

         Layout : left-symmetric
     Chunk Size : 64K

      Number Major Minor RaidDevice State
this 1 8 17 1 active sync /dev/sdb1

   0 0 8 113 0 active sync /dev/sdh1
   1 1 8 17 1 active sync /dev/sdb1
   2 2 8 97 2 active sync /dev/sdg1
   3 3 8 33 3 active sync /dev/sdc1

root@mserver:~# mdadm –examine /dev/sdd1

/dev/sdd1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 2f331560:fc85feff:5457a8c1:6e047c67 (local to host mserver)
  Creation Time : Sun Feb 1 20:53:39 2009
     Raid Level : raid5
  Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
     Array Size : 2930279808 (2794.53 GiB 3000.61 GB)
   Raid Devices : 4
  Total Devices : 2
Preferred Minor : 0

    Update Time : Sat Apr 20 18:37:23 2013
          State : active
 Active Devices : 2
Working Devices : 2
 Failed Devices : 2
  Spare Devices : 0
       Checksum : 6c812869 - correct
         Events : 955205

         Layout : left-symmetric
     Chunk Size : 64K

      Number Major Minor RaidDevice State
this 0 8 113 0 active sync /dev/sdh1

   0 0 8 113 0 active sync /dev/sdh1
   1 1 0 0 1 faulty removed
   2 2 8 97 2 active sync /dev/sdg1
   3 3 0 0 3 faulty removed

root@mserver: ~# mdadm –examine /dev/sde1

/dev/sde1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 2f331560:fc85feff:5457a8c1:6e047c67 (local to host mserver)
  Creation Time : Sun Feb 1 20:53:39 2009
     Raid Level : raid5
  Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
     Array Size : 2930279808 (2794.53 GiB 3000.61 GB)
   Raid Devices : 4
  Total Devices : 2
Preferred Minor : 0

    Update Time : Sun Apr 21 14:00:43 2013
          State : clean
 Active Devices : 1
Working Devices : 1
 Failed Devices : 2
  Spare Devices : 0
       Checksum : 6c90cc70 - correct
         Events : 955219

         Layout : left-symmetric
     Chunk Size : 64K

      Number Major Minor RaidDevice State
this 2 8 97 2 active sync /dev/sdg1

   0 0 0 0 0 removed
   1 1 0 0 1 faulty removed
   2 2 8 97 2 active sync /dev/sdg1
   3 3 0 0 3 faulty removed

root@mserver:~# mdadm –examine /dev/sdf1

/dev/sdf1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 2f331560:fc85feff:5457a8c1:6e047c67 (local to host mserver)
  Creation Time : Sun Feb 1 20:53:39 2009
     Raid Level : raid5
  Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
     Array Size : 2930279808 (2794.53 GiB 3000.61 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0

    Update Time : Sat Apr 20 13:22:27 2013
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 6c8f71b7 - correct
         Events : 955190

         Layout : left-symmetric
     Chunk Size : 64K

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

   0 0 8 113 0 active sync /dev/sdh1
   1 1 8 17 1 active sync /dev/sdb1
   2 2 8 97 2 active sync /dev/sdg1
   3 3 8 33 3 active sync /dev/sdc1

Ho alcune note che suggeriscono che le unità erano originariamente assemblate come segue:

md0 : active raid5 sdb1[1] sdc1[3] sdh1[0] sdg1[2]
      2930279808 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]

[Edit3]

Guardando il log sembra che sia successo quanto segue (in base allo Update Time nei risultati --examine):

  1. sdb e sdf sono stati messi fuori uso poco dopo le 13:22 del 20
  2. sdd è stato messo fuori uso poco dopo le 18:37 del 20
  3. il server è stato spento poco dopo le 13:22. il server è stato spento dopo le 14:00 del 1°

Dato che due dischi sono andati giù (apparentemente) simultaneamente, penso che dovrebbe essere ragionevolmente sicuro assumere che l'array non sia stato scritto dopo quel punto(?) e quindi dovrebbe essere relativamente sicuro forzarlo a reintegrarsi nell'ordine corretto? Qual è il comando più sicuro per farlo e c'è un modo per farlo senza scrivere alcuna modifica?

Advertisement

Risposte (3)

28
28
28
2013-06-04 09:14:49 +0000

L'etichetta S significa che il disco è considerato come “spare”. Dovresti provare a fermare e riavviare l'array:

mdadm --stop /dev/md0
  mdadm --assemble --scan

per riassemblare l'array e se questo non funziona, potresti aver bisogno di aggiornare il tuo mdadm.conf, vedi per esempio questa domanda per dettagli su come farlo.

9
9
9
2014-09-13 01:33:49 +0000

Questa domanda è un po’ vecchia, ma la risposta potrebbe aiutare qualcuno ad affrontare una situazione simile. Guardando i conteggi degli eventi dall'output di mdadm –examine che hai fornito, sembrano abbastanza vicini (955190 - per sdb1 e sdf1, 955219 per sde1 e per sdd1 hai 955205). Se sono inferiori a 40-50, questo è OK, e in questo caso la linea d'azione raccomandata è di assemblare il tuo array manualmente, forzando mdadm ad accettare le unità nonostante la differenza di conteggio degli eventi:

Fermare l'array:

mdadm --stop /dev/md0

Poi prova a riassemblare l'array manualmente:

mdadm --assemble --force /dev/md0 /dev/sdb1 /dev/sdd1 /dev/sde1 /dev/sdf1

Controllare lo stato dell'array, per esaminare se la lista/struttura delle unità è OK (la parte inferiore dell'output del comando mostrerà quale unità è in quale stato e in quale posizione nell'array):

mdadm --detail /dev/md0

Se la struttura è OK, controlla il progresso della ricostruzione:

cat /proc/mdstat
0
Advertisement
0
0
2013-06-04 09:02:31 +0000

Potete attivare Raid md0 con il seguente comando

mdadm -A /dev/md0

e questo comando per aggiornare il file mdadm.conf

mdadm --examine --scan >> /etc/mdadm/mdadm.conf
Advertisement