* [patch] raidstart problem - weakness or bug
@ 2003-11-14 0:07 Roger Gammans
2003-11-14 0:23 ` Neil Brown
0 siblings, 1 reply; 2+ messages in thread
From: Roger Gammans @ 2003-11-14 0:07 UTC (permalink / raw)
To: linux-raid
[-- Attachment #1.1: Type: text/plain, Size: 969 bytes --]
Hi
I'v decided to build a raid set for on one of my machines here
and while setting I did a simulated fail test so I knew what to expect
out of the fail/recovery process.
In the course of this I discover that raidstart (I used debian stable
to start with but reproduced and patched on raidtools 1.00-3)
won't start and array where the first drive listed in /etc/raidtab
has failed - or more accurately whose superblock is not readable.
An afternoons read through the code has led me to suggest this
patch as a fix. No doubt the more experienced raid hands will tell
me this is wrong for some subtle reason i can't see. ;_)
So what have I got wrong ?
TTFN
--
Roger. Home| http://www.sandman.uklinux.net/
Master of Peng Shui. (Ancient oriental art of Penguin Arranging)
Work|Independent Systems Consultant | http://www.firstdatabase.co.uk/
So what are the eigenvalues and eigenvectors of 'The Matrix'? --anon
[-- Attachment #1.2: raidtools.diff --]
[-- Type: text/plain, Size: 676 bytes --]
diff -urN raidtools-1.00.3/raidlib.c raidtools-1.00.3-rgg/raidlib.c
--- raidtools-1.00.3/raidlib.c Wed Jan 15 08:58:25 2003
+++ raidtools-1.00.3-rgg/raidlib.c Thu Nov 13 16:51:37 2003
@@ -460,11 +460,19 @@
case raidstart:
{
struct stat s;
+ int i=0;
+ for ( i=0; i< MD_SB_DISKS; ++i) {
+
+ if (!cfg->device_name[i][0]) {
+ rc++;
+ break;
+ }
+ stat (cfg->device_name[i], &s);
- stat (cfg->device_name[0], &s);
-
- fd = open_or_die(cfg->md_name);
- if (do_mdstart (fd, cfg->md_name, s.st_rdev)) rc++;
+ fd = open_or_die(cfg->md_name);
+ if ( ! do_mdstart (fd, cfg->md_name, s.st_rdev))
+ break;
+ }
break;
}
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] raidstart problem - weakness or bug
2003-11-14 0:07 [patch] raidstart problem - weakness or bug Roger Gammans
@ 2003-11-14 0:23 ` Neil Brown
0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2003-11-14 0:23 UTC (permalink / raw)
To: Roger Gammans; +Cc: linux-raid
On Friday November 14, roger@computer-surgery.co.uk wrote:
> Hi
>
> I'v decided to build a raid set for on one of my machines here
> and while setting I did a simulated fail test so I knew what to expect
> out of the fail/recovery process.
>
> In the course of this I discover that raidstart (I used debian stable
> to start with but reproduced and patched on raidtools 1.00-3)
> won't start and array where the first drive listed in /etc/raidtab
> has failed - or more accurately whose superblock is not readable.
>
> An afternoons read through the code has led me to suggest this
> patch as a fix. No doubt the more experienced raid hands will tell
> me this is wrong for some subtle reason i can't see. ;_)
>
> So what have I got wrong ?
>
You have tried to fix a program that really is not worth saving.
raidstart should be erradicated from the universe. It is more of a
problem than a solution. :-)
Apart from the problem you noticed which is fixable, there is the fact
that it depends on device numbers being stable and uses the device
numbers out of the superblock of one device to find all other devices.
This mostly works OK with IDE, but with SCSI, devices can change there
number (major/minor) and name quite easily and then raidstart cannot
cope at all.
Use mdadm - it has a much better approach.
Debian/stable has the fairly old 0.7.2, which should work but is not
the latest by a long way. You can find the latest at
http://www.kernel.org/pub/linux/utils/raid/mdadm/
NeilBrown
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-11-14 0:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-14 0:07 [patch] raidstart problem - weakness or bug Roger Gammans
2003-11-14 0:23 ` Neil Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.