ubuntuusers.de

Am Samstag, 8.3., wird ubuntuusers ab 20 Uhr für einige Stunden nicht erreichbar sein. Grund ist eine Datenbankmigration.

Software RAID5 inactive (mdadm)

Status: Gelöst | Ubuntu-Version: Server 8.10 (Intrepid Ibex)
Antworten |

Spike42

Anmeldungsdatum:
7. November 2007

Beiträge: Zähle...

Wohnort: Hannover

Hallo, ich habe versucht einen bestehenden Fileserver mit 2x Software-RAID5 in eine virtuelle Maschine umzuziehen. Ich befürchte ich habe mir dabei die beiden RAIDs zerstört, habe aber noch etwas Hoffnung, dass mir jemand helfen kann die Daten wieder herzustellen. Aktuell habe ich eine frische Installation Ubuntu Server 8.10 64Bit aufgesetzt, um zu versuchen die RAIDs wieder herzustellen.

Es handelt sich um 5x 500GB und 4x 1500GB. Per fdisk sehe ich, dass die Partitionen "linux raid autodetect" noch vorhanden sind. Auch ein mdadm --examine auf die einzelnen Platten sieht vielversprechend aus. In proc/mdstat werden beide RAIDs als "inactive" angezeigt - die Zuordnung der Partitionen ist aber korrekt. mdmadm --assemble bzw. mdadm --add schlägt jedoch fehl.

Die Partitionen auf den einzelnen Platten sollten noch vorhanden sein:

# fdisk -l /dev/sd[b-j]

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7bfd566e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       60801   488384001   fd  Linux raid autodetect

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
16 heads, 63 sectors/track, 969021 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0xda62733c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      969021   488386552+  fd  Linux raid autodetect

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
16 heads, 63 sectors/track, 969021 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0x1d7db9e6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1      969021   488386552+  fd  Linux raid autodetect

Disk /dev/sde: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7bfd566c

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1       60801   488384001   fd  Linux raid autodetect

Disk /dev/sdf: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7bfd566f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1       60801   488384001   fd  Linux raid autodetect

Disk /dev/sdg: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1      182401  1465136001   fd  Linux raid autodetect

Disk /dev/sdh: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1               1      182401  1465136001   fd  Linux raid autodetect

Disk /dev/sdi: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdi1               1      182401  1465136001   fd  Linux raid autodetect

Disk /dev/sdj: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdj1               1      182401  1465136001   fd  Linux raid autodetect

Die RAIDs werden korrekt erkannt, aber nicht gestartet. Interessanterweise sind alle Partitionen als "Spare" markiert. Eigentlich sollten die RAIDs aber gar keine Spare-Laufwerke enthalten!

# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md2 : inactive sdh1[1](S) sdg1[3](S) sdj1[2](S) sdi1[0](S)
      5860543744 blocks

md1 : inactive sde1[0](S) sdf1[4](S) sdc1[3](S) sdd1[2](S) sdb1[1](S)
      2441924672 blocks

unused devices: <none>
# mdadm --detail /dev/md1
mdadm: md device /dev/md1 does not appear to be active.
# mdadm --assemble --scan
mdadm: /dev/md1 assembled from 1 drive - not enough to start the array.
mdadm: /dev/md2 assembled from 2 drives - not enough to start the array.
# mdadm --add /dev/md1 /dev/sdb1
mdadm: cannot get array info for /dev/md1

Die Ausgabe von mdadm --examine sieht für alle beteiligten Platten gut aus. Auffällig ist allerdings, dass die angezeigte Partitionsbezeichnung nicht mit aufgerufenen übereinstimmt. Das folgende Beispiel sollte sdb1 anzeigen, --examine liefert aber sde1 zurück. Ich führe dies auf meine Versuche zurück, die Partitionen an eine unter KVM laufende VM "durchzureichen". Hierfür hatte ich in der entsprechenden Konfigurationsdatei (/etc/qemu-server/102.conf) Einträge in folgender Form erstellt: scsi0: /dev/sdb scsi1: /dev/sdc ...

# mdadm --examine /dev/sdb1
/dev/sdb1:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 0242492e:e0a90f17:2e29483d:f114274d
  Creation Time : Wed Apr  8 20:39:54 2009
     Raid Level : raid5
  Used Dev Size : 488383936 (465.76 GiB 500.11 GB)
     Array Size : 1953535744 (1863.04 GiB 2000.42 GB)
   Raid Devices : 5
  Total Devices : 5
Preferred Minor : 1

    Update Time : Sun Sep 13 10:51:51 2009
          State : clean
 Active Devices : 5
Working Devices : 5
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 5cfae0e2 - correct
         Events : 14

         Layout : left-symmetric
     Chunk Size : 64K

      Number   Major   Minor   RaidDevice State
this     1       8       65        1      active sync   /dev/sde1

   0     0       8       49        0      active sync   /dev/sdd1
   1     1       8       65        1      active sync   /dev/sde1
   2     2       8       17        2      active sync   /dev/sdb1
   3     3       8       33        3      active sync   /dev/sdc1
   4     4       8       81        4      active sync   /dev/sdf1
# mdadm --examine /dev/sdg1
/dev/sdg1:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 39201a49:cc659753:ae785470:003d954d
  Creation Time : Sun Dec 14 14:07:00 2008
     Raid Level : raid5
  Used Dev Size : 1465135936 (1397.26 GiB 1500.30 GB)
     Array Size : 4395407808 (4191.79 GiB 4500.90 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 2

    Update Time : Tue Sep 15 11:39:47 2009
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 48cebe88 - correct
         Events : 990188

         Layout : left-symmetric
     Chunk Size : 64K

      Number   Major   Minor   RaidDevice State
this     3       8      145        3      active sync   /dev/sdj1

   0     0       8      113        0      active sync   /dev/sdh1
   1     1       8       97        1      active sync   /dev/sdg1
   2     2       8      129        2      active sync   /dev/sdi1
   3     3       8      145        3      active sync   /dev/sdj1

mdadm.conf:

# definitions of existing MD arrays
ARRAY /dev/md1 level=raid5 num-devices=5 UUID=0242492e:e0a90f17:2e29483d:f114274d
ARRAY /dev/md2 level=raid5 num-devices=4 UUID=39201a49:cc659753:ae785470:003d954d

Ich bin für jede Hilfe dankbar meine Daten wieder herzustellen! Spike

Spike42

(Themenstarter)

Anmeldungsdatum:
7. November 2007

Beiträge: Zähle...

Wohnort: Hannover

So schnell kann's gehen. Eben dachte ich noch meine Daten wären verloren und jetzt bin ich durch Zufall auf einen Weg gestoßen die RAIDs wieder herzustellen. Folgende Vorgehensweise hat mich zum Ziel gebracht:

Informationen zu den RAIDs anzeigen. Hier läuft md1 schon wieder. md2 ist noch fehlerhaft:

# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md2 : inactive sdh1[1](S) sdg1[3](S) sdj1[2](S) sdi1[0](S)
      5860543744 blocks

md1 : active raid5 sdd1[2] sdc1[3] sdb1[1] sdf1[4] sde1[0]
      1953535744 blocks level 5, 64k chunk, algorithm 2 [5/5] [UUUUU]

unused devices: <none>

Ich habe versucht das RAID zu starten, was einen Fehler lieferte:

# mdadm --run /dev/md2
mdadm: failed to run array /dev/md2: Input/output error

Der Status von md2 sah danach schon ganz anders aus:

# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md2 : inactive sdh1[1] sdg1[3]
      2930271872 blocks

md1 : active raid5 sdd1[2] sdc1[3] sdb1[1] sdf1[4] sde1[0]
      1953535744 blocks level 5, 64k chunk, algorithm 2 [5/5] [UUUUU]

unused devices: <none>

Ich habe dann die beiden fehlenden Partitionen wieder hinzugefügt:

# mdadm --add /dev/md2 /dev/sdi1
mdadm: re-added /dev/sdi1

# mdadm --add /dev/md2 /dev/sdj1
mdadm: re-added /dev/sdj1

Anschließend nochmal den Status angesehen - sieht gut aus:

# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md2 : inactive sdj1[2] sdi1[0] sdh1[1] sdg1[3]
      5860543744 blocks

md1 : active raid5 sdd1[2] sdc1[3] sdb1[1] sdf1[4] sde1[0]
      1953535744 blocks level 5, 64k chunk, algorithm 2 [5/5] [UUUUU]

unused devices: <none>

Und zuletzt das RAID gestartet:

# mdadm --run /dev/md2
mdadm: started /dev/md2

Et voila - alles wieder gut. Puh - Schwein gehabt!

# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md2 : active raid5 sdj1[2] sdi1[0] sdh1[1] sdg1[3]
      4395407808 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]

md1 : active raid5 sdd1[2] sdc1[3] sdb1[1] sdf1[4] sde1[0]
      1953535744 blocks level 5, 64k chunk, algorithm 2 [5/5] [UUUUU]

unused devices: <none>
mdadm --examine /dev/sdg1
/dev/sdg1:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 39201a49:cc659753:ae785470:003d954d
  Creation Time : Sun Dec 14 14:07:00 2008
     Raid Level : raid5
  Used Dev Size : 1465135936 (1397.26 GiB 1500.30 GB)
     Array Size : 4395407808 (4191.79 GiB 4500.90 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 2

    Update Time : Sat Sep 19 16:28:50 2009
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 48d44817 - correct
         Events : 990188

         Layout : left-symmetric
     Chunk Size : 64K

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

   0     0       8      129        0      active sync   /dev/sdi1
   1     1       8      113        1      active sync   /dev/sdh1
   2     2       8      145        2      active sync   /dev/sdj1
   3     3       8       97        3      active sync   /dev/sdg1

Picknicker1

Anmeldungsdatum:
7. Juni 2008

Beiträge: 84

Ich habe ein ähnliches Problem mit RAID1 auf aktuellem Ubuntu Server. Wenn ich jedoch

 mdadm --add /dev/md2 /dev/sdb3

eingebe erhalte ich ein: Cannot open /dev/sdb3: Device or resource busy.

Es ist nichts gemountet, es wurde komplett über ein Rettungssystem gebootet. Auch ein SMART Test läuft ohne Fehler durch.

Kann mir da einer noch n Tipp geben?

Picknicker1

Anmeldungsdatum:
7. Juni 2008

Beiträge: 84

Keiner Plan davon?

frostschutz

Avatar von frostschutz

Anmeldungsdatum:
18. November 2010

Beiträge: 7767

Warum machst du keinen neuen Thread dazu auf? Der hier ist uralt, zudem als gelöst markiert, und jedes Problem ist anders.

sdb3 busy: wird wohl stimmen, also musst du gucken wieso. mount, md, dm, loop, ... irgendwas wirds haben

Antworten |