----- Message from [EMAIL PROTECTED] ---------
    Date: Mon, 22 Oct 2007 21:46:08 +1000
    From: Sam Redfern <[EMAIL PROTECTED]>
Reply-To: Sam Redfern <[EMAIL PROTECTED]>
 Subject: Fwd: issues rebuilding raid array.
      To: [email protected]


The array was build using 2.6.18-7 Now i'm using  2.6.21-2

I'm trying to recreate the raid array with the following command and
this is the error I get:

mca4:~# mdadm -Av /dev/md1 /dev/sdb /dev/sdc /dev/sdd /dev/sde
/dev/sdf /dev/sdg
mdadm: looking for devices for /dev/md1
mdadm: no RAID superblock on /dev/sdc
mdadm: /dev/sdc has no superblock - assembly aborted

So I figure, oh look the disk sdc has gone cactus, I'll just remove it
from the list. One of the advantages of mdadm.

mca4:~# mdadm -Av /dev/md1 /dev/sdb /dev/sdd /dev/sde /dev/sdf /dev/sdg
mdadm: looking for devices for /dev/md1
mdadm: /dev/sdb is identified as a member of /dev/md1, slot -1.
mdadm: /dev/sdd is identified as a member of /dev/md1, slot 0.
mdadm: /dev/sde is identified as a member of /dev/md1, slot 1.
mdadm: /dev/sdf is identified as a member of /dev/md1, slot 5.
mdadm: /dev/sdg is identified as a member of /dev/md1, slot 4.
mdadm: added /dev/sde to /dev/md1 as 1
mdadm: no uptodate device for slot 2 of /dev/md1
mdadm: no uptodate device for slot 3 of /dev/md1
mdadm: added /dev/sdg to /dev/md1 as 4
mdadm: added /dev/sdf to /dev/md1 as 5
mdadm: failed to add /dev/sdb to /dev/md1: Invalid argument
mdadm: added /dev/sdd to /dev/md1 as 0
mdadm: /dev/md1 assembled from 4 drives - not enough to start the array.

If found this really difficult to understand considering that I can
get the output of mdamd -E /dev/sdb (other disks included to overload
you with information)

mdadm -E /dev/sd[b-h]

/dev/sdb:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 4e3b82e1:f5604e19:a9c9775f:49745adf
  Creation Time : Fri Oct  5 09:18:25 2007
     Raid Level : raid5
    Device Size : 312571136 (298.09 GiB 320.07 GB)
     Array Size : 1562855680 (1490.46 GiB 1600.36 GB)
   Raid Devices : 6
  Total Devices : 6
Preferred Minor : 1

    Update Time : Tue Oct 16 20:03:13 2007
          State : clean
 Active Devices : 6
Working Devices : 6
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 80d47486 - correct
         Events : 0.623738

         Layout : left-symmetric
     Chunk Size : 64K

      Number   Major   Minor   RaidDevice State
this     6       8       16       -1      spare   /dev/sdb

   0     0       8       80        0      active sync   /dev/sdf
   1     1       8      128        1      active sync   /dev/.static/dev/sdi
   2     2       8      144        2      active sync   /dev/.static/dev/sdj
   3     3       8       16        3      active sync   /dev/sdb
   4     4       8       64        4      active sync   /dev/sde
   5     5       8       96        5      active sync   /dev/sdg


If anyone could offer a solution I'd be forever grateful, also to
prove that supporting open source isn't all free labour I'll send you
can choose one of 1 of 2 Nintendo DS games, the new radiohead album or
a cree flash light. :)


----- End message from [EMAIL PROTECTED] -----

Hey, this looks similar to what I recently had. (http://www.mail-archive.com/[email protected]/msg09306.html) I my case a RAID5 reshape was interrupted and the new devices were also marked spare with slot -1.
Apply the attached patch to mdadm-2.6.3, build then do:
 mdadm -S /dev/md1
 ./mdadm -Av /dev/md1 --update=this /dev/sd[b-g]
That should update the slot on /dev/sdb. Then:
 mdadm -S /dev/md1
 ./mdadm -Av /dev/md1 /dev/sd[bcdefg]

should bring back your array in degraded mode.
If it works send your gifts to Neil Brown <[EMAIL PROTECTED]>, he wrote the patch! :)
Good luck!


========================================================================
#    _  __          _ __     http://www.nagilum.org/ \n icq://69646724 #
#   / |/ /__ ____ _(_) /_ ____ _  [EMAIL PROTECTED] \n +491776461165 #
#  /    / _ `/ _ `/ / / // /  ' \  Amiga (68k/PPC): AOS/NetBSD/Linux   #
# /_/|_/\_,_/\_, /_/_/\_,_/_/_/_/   Mac (PPC): MacOS-X / NetBSD /Linux #
#           /___/     x86: FreeBSD/Linux/Solaris/Win2k  ARM9: EPOC EV6 #
========================================================================


----------------------------------------------------------------
cakebox.homeunix.net - all the machine one needs..

diff --git a/Grow.c b/Grow.c
index 825747e..8ad1537 100644
--- a/Grow.c
+++ b/Grow.c
@@ -978,5 +978,5 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, 
int *fdlist, int cnt
                /* And we are done! */
                return 0;
        }
-       return 1;
+       return 0;
 }
diff --git a/mdadm.c b/mdadm.c
index 40fdccf..7e7e803 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -584,6 +584,8 @@ int main(int argc, char *argv[])
                                exit(2);
                        }
                        update = optarg;
+                       if (strcmp(update, "this")==0) 
+                               continue;
                        if (strcmp(update, "sparc2.2")==0) 
                                continue;
                        if (strcmp(update, "super-minor") == 0)
diff --git a/super0.c b/super0.c
index 0396c2c..e33e623 100644
--- a/super0.c
+++ b/super0.c
@@ -394,6 +394,21 @@ static int update_super0(struct mdinfo *info, void *sbv, 
char *update,
                        fprintf (stderr, Name ": adjusting superblock of %s for 
2.2/sparc compatability.\n",
                                 devname);
        }
+       if (strcmp(update, "this") == 0) {
+               /* to fix a particular corrupt superblock.
+               */
+               int i;
+               for (i=0; i<10; i++)
+                       if (sb->disks[i].major == sb->this_disk.major &&
+                           sb->disks[i].minor == sb->this_disk.minor) {
+                               if (sb->this_disk.number == sb->disks[i].number)
+                                       break;
+                               fprintf(stderr, Name ": Setting this disk from 
%d to %d\n",
+                                       sb->this_disk.number, 
sb->disks[i].number);
+                               sb->this_disk = sb->disks[i];
+                               break;
+                       }
+       }
        if (strcmp(update, "super-minor") ==0) {
                sb->md_minor = info->array.md_minor;
                if (verbose > 0)

Attachment: pgp3Q8vYLwl3x.pgp
Description: PGP Digital Signature

Reply via email to