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
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