PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Linux Software Raid - Verständnisfrage



baetmaen
17.11.06, 13:01
Hi,

mein Server ist auf einem Linux Software Raid installiert. Yast hat automatisch Einträge für das booten der Platte ada bzw. sdb angelegt. Im Hintergrund wacht ein Script aus c't oder Linux Magazin über den Raid Status.

Wäre das System bootfähig, wenn eine der Platten aussteigt ?
Und wie kompliziert wäre es das System auf einen 3ware Raid Controller umzustellen ?

fdisk -l
Disk /dev/sda: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 32 257008+ fd Linux raid autodetect
/dev/sda2 33 2643 20972857+ fd Linux raid autodetect
/dev/sda3 2644 36479 271787670 f W95 Ext'd (LBA)
/dev/sda5 2644 2774 1052226 82 Linux swap / Solaris
/dev/sda6 2775 32104 235593193+ fd Linux raid autodetect
/dev/sda7 32105 36477 35126091 fd Linux raid autodetect

Disk /dev/sdb: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 32 257008+ fd Linux raid autodetect
/dev/sdb2 33 2643 20972857+ fd Linux raid autodetect
/dev/sdb3 2644 36479 271787670 f W95 Ext'd (LBA)
/dev/sdb5 2644 2774 1052226 82 Linux swap / Solaris
/dev/sdb6 2775 32104 235593193+ fd Linux raid autodetect
/dev/sdb7 32105 36477 35126091 fd Linux raid autodetect

grub menu.lst:
# Modified by YaST2. Last modification on Mi Aug 31 14:31:28 UTC 2005

color white/blue black/light-gray
default 0
timeout 8

###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE LINUX 9.3
kernel (hd0,0)/vmlinuz root=/dev/md2 selinux=0 splash=silent x11i=vesa resume=/dev/sda5 showopts
initrd (hd0,0)/initrd

###Don't change this comment - YaST2 identifier: Original name: SUSE LINUX 9.3 (/dev/sda1)###
title SUSE LINUX 9.3 (/dev/sda1)
kernel (hd0,0)/vmlinuz root=/dev/md2 selinux=0 splash=silent x11i=vesa resume=/dev/sda5 showopts
initrd (hd0,0)/initrd

###Don't change this comment - YaST2 identifier: Original name: SUSE LINUX 9.3 (/dev/sdb1)###
title SUSE LINUX 9.3 (/dev/sdb1)
kernel (hd0,0)/vmlinuz root=/dev/md2 selinux=0 splash=silent x11i=vesa resume=/dev/sda5 showopts
initrd (hd0,0)/initrd

###Don't change this comment - YaST2 identifier: Original name: floppy###
title Diskette
root (fd0)
chainloader +1

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- SUSE LINUX 9.3
kernel (hd0,0)/vmlinuz root=/dev/md2 showopts ide=nodma apm=off acpi=off vga=normal noresume selinux=0 barrier=off nosmp noapic maxcpus=0 3
initrd (hd0,0)/initrd

raidcheck Script:
#!/usr/bin/perl -w
require 5.002;
use warnings;
my $email = "jbingemer\@oilgear.de";
my $hostname = `hostname -f`;
my $input = "/proc/mdstat";
my $message = "";
my $partition = "";
my $mail = `which mail`;
chomp $mail;
open (INPUTFILE, "$input");
while(<INPUTFILE>) {
if (/^md(\d+)/) {
$partition = $1;
}
if (/\[(\d+)\/(\d+)\]\s\[(.*)\]/) {
my $disk_all = $1;
my $disk_ok = $2;
my $array_stat = $3;
if ($disk_all != $disk_ok) {
$message = $message."/dev/md$partition is broken\n";
}
}
}
if ($message) {
my $mdstat = `cat $input`;
$message = $message."\n\n".$mdstat;
`echo "$message" | $mail -s "RAID Error at $hostname" $email`
}

Mountpoints/Partitionen
/dev/md0 /boot
/dev/md1 /usr
/dev/md2 /
/dev/md3 /home

Danke
Jörg

RichieX
17.11.06, 13:52
Wäre das System bootfähig, wenn eine der Platten aussteigt ?
Ja (wenn es eine Spiegelung ist), an den Volumes ansich wird nichts geändert.

Und wie kompliziert wäre es das System auf einen 3ware Raid Controller umzustellen ?
Nicht so schlimm.
- Daten sichern
- Grub entsprechend konfigurieren (md umstellen auf evtl. sd)
- fstab anpassen
- Grub loader neu schreiben
fertig.
Hab ich was vergessen? PS: Ja: 3ware RAID Treiber in die initrd packen.

RichieX

baetmaen
17.11.06, 14:21
Ja (wenn es eine Spiegelung ist), an den Volumes ansich wird nichts geändert.


:) Es ist eine Spiegelung. Also werde ich mal warten wie sehr die Belastung mit 40 Usern ist. Wenn der Server I/O mäßig nicht hinterherkommt kann ich immer noch einen Controller einbauen, oder ?

Jörg

bla!zilla
17.11.06, 14:25
Das ist weniger ein Problem des Software-Mirrors als viel mehr der darunterliegenden Platten. Ich betreibe Server die sehr große Volumes (>500 GB) für sehr I/O intensive Anwendungen (sehr viel mehr Last als bei 40 Usern) über einen Software-Spiegel synchron halten. Kostet ca. 5 bis 10%. Ist also noch vertretbar.

baetmaen
17.11.06, 14:36
Alles klar, vielen Dank für die Praxistipps :D

Jörg