Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Software Raid 1 - kurze Hilfe bei Wechsel der Festplatte
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
KaterGonzo
Apprentice
Apprentice


Joined: 01 Apr 2004
Posts: 155

PostPosted: Mon Aug 20, 2012 7:27 am    Post subject: Software Raid 1 - kurze Hilfe bei Wechsel der Festplatte Reply with quote

Guten Morgen liebe Community,

heute morgen habe ich festgestellt, dass eine Partition im Software-Raid als Failed angezeigt wird. Da es sich beim Server um einen Remote-Server handelt, der ein paar Hundert Kilometer entfernt steht, möchte ich beim Wechsel der Festplatte sicher gehen, dass ich keinen Logikfehler drin habe. Daher wäre es prima, wenn jemand mal drüber schauen könnte.

Aktuelle Ausgangssituation

Etwas unsortiert habe ich zur Zeit folgende Platten in meinem System

Code:
/dev/sda -> Ersatzfestplatte
/dev/sdb -> Aktiv
/dev/sdc -> Aktiv und defekte Partition


sdb + sdc bilden folgendes RAID Array

Code:
# cat /proc/mdstat
Personalities : [raid1]
md126 : active raid1 sdc1[1] sdb1[0]
      104320 blocks [2/2] [UU]

md1 : active raid1 sdc2[1] sdb2[0]
      1003968 blocks [2/2] [UU]

md127 : active raid1 sdc3[2](F) sdb3[0]
      77039616 blocks [2/1] [U_]

unused devices: <none>


Wie man sieht, ist /dev/sdc3 fehlerhaft.

Hier die Ausgabe von fdisk

Code:
# fdisk -l

Disk /dev/sda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3f6445f4

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5db2d17c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          13      104391   fd  Linux raid autodetect
/dev/sdb2              14         138     1004062+  fd  Linux raid autodetect
/dev/sdb3             139        9729    77039707+  fd  Linux raid autodetect

Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5db2d17c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1          13      104391   fd  Linux raid autodetect
/dev/sdc2              14         138     1004062+  fd  Linux raid autodetect
/dev/sdc3             139        9729    77039707+  fd  Linux raid autodetect

Disk /dev/md127: 78.9 GB, 78888566784 bytes
2 heads, 4 sectors/track, 19259904 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/md127 doesn't contain a valid partition table

Disk /dev/md1: 1028 MB, 1028063232 bytes
2 heads, 4 sectors/track, 250992 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md126: 106 MB, 106823680 bytes
2 heads, 4 sectors/track, 26080 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/md126 doesn't contain a valid partition table


Festplatte ersetzen: Meine geplante Vorgehensweise:

Ziel: /dev/sdc durch /dev/sda ersetzen

1. /dev/sdc entfernen
Code:
# mdadm --manage /dev/md126 --remove /dev/sdc1
# mdadm --manage /dev/md1   --remove /dev/sdc2
# mdadm --manage /dev/md127 --remove /dev/sdc3


2. /dev/sda partitionieren
Code:
sfdisk -d /dev/sdb | sfdisk /dev/sda


3. MBR kopieren
Code:
dd if=/dev/sdb of=/dev/sda bs=512 count=1


4. /dev/sda zum Raid hinzufügen
Code:
# mdadm --manage /dev/md126 --add /dev/sda1
# mdadm --manage /dev/md1   --add /dev/sda2
# mdadm --manage /dev/md127 --add /dev/sda3


Fragen
1. Ist die Vorgehensweise vollständig oder habe ich etwas vergessen?
2. Macht es eventuelle Sinn, die defekte Partition neu einzurichten oder gibt die Festplatte bald den Geist auf?

Vielen Dank im Voraus!
Back to top
View user's profile Send private message
b3rT
n00b
n00b


Joined: 09 Jun 2003
Posts: 71
Location: Germany

PostPosted: Mon Aug 20, 2012 12:14 pm    Post subject: Reply with quote

zu 2:
Dass Deine Festplatte defekt ist, würde ich nicht alleine daraus schliessen, weil das Raid versagt. Ein unsauberers Herunterfahren/Kernel-Panic könnte hier auch der Auslöser sein. Ich würde hier noch weitere Nachforschungen anstellen (z.B. smarttools, dmesg etc) und es erstmal mit einem recovery versuchen.
Code:
raidhotremove /dev/md127 /dev/sdc3
raidhotadd /dev/md127 /dev/sdc3


zu 1:
Quote:
# mdadm --manage /dev/md126 --remove /dev/sdc1
# mdadm --manage /dev/md1 --remove /dev/sdc2

sdc1/sdc2 sollte vorher auch auf failed gesetzt werden
Code:
mdadm --manage /dev/md126 --fail /dev/sdc1
mdadm --manage /dev/md1 --fail /dev/sdc2
Back to top
View user's profile Send private message
KaterGonzo
Apprentice
Apprentice


Joined: 01 Apr 2004
Posts: 155

PostPosted: Mon Aug 20, 2012 2:17 pm    Post subject: Reply with quote

Danke schön. Ich habe die Partition neu "geadded".

Leider hatte ich Deine Befehle nicht parat, daher bin ich wiefolgt vorgegangen:

Code:
 # HDD Status OK
smartctl -A -H /dev/sdc

# REmove
mdadm --manage /dev/md127 --remove /dev/sdc3

# re-add
mdadm --manage /dev/md127 --re-add /dev/sdc3


Schnurrt nun wieder...


Last edited by KaterGonzo on Mon Aug 20, 2012 6:19 pm; edited 1 time in total
Back to top
View user's profile Send private message
b3rT
n00b
n00b


Joined: 09 Jun 2003
Posts: 71
Location: Germany

PostPosted: Mon Aug 20, 2012 4:24 pm    Post subject: Reply with quote

Stimmt auch, die Aufrufe waren Bestandteil der raidtools, die es schon einige Tage nicht mehr gibt. Hatte mit damals zur Umstellung auf mdadm Skripte mit den gewohnten Aufrufen angelegt. ;)

Fein, dass es wieder funktioniert.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum