Here's a patch that will cause raidstart to work when it can't get the
superblock from the first drive mentioned in the raidtab.
I've also included it as an attachment in case Outlook does its evil magic
to the text.

Basically, I changed raidlib to try starting the raid with each of the
devices in it until it either succeeds or runs out of devices.

Dale Stephenson
[EMAIL PROTECTED]

--- raidlib.c.orig      Fri Jun  8 11:55:44 2001
+++ raidlib.c   Fri Jun  8 12:15:28 2001
@@ -379,11 +379,21 @@
                case raidstart:
                {
                        struct stat s;
-
-                       stat (cfg->device_name[0], &s);
+                       int i;
 
                        fd = open_or_die(cfg->md_name);
-                       if (do_mdstart (fd, cfg->md_name, s.st_rdev)) rc++;
+                       rc++;
+                       for (i =0; i < MD_SB_DISKS; i++) {
+                         if (cfg->device_name[i] == NULL)
+                           break;
+
+                         stat (cfg->device_name[i], &s);
+
+                         if (do_mdstart (fd, cfg->md_name, s.st_rdev) == 0)
{
+                           rc--;
+                           break;
+                         }
+                       }
                        break;
                }

raidtools-raidstart.patch

Reply via email to