Re: looking for advice on raid0+raid5 array recovery with mdadm and sector offset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 21 Jan 2014 09:11:44 +1100 NeilBrown <neilb@xxxxxxx> wrote:

> On Mon, 20 Jan 2014 16:43:38 -0500 den Hoog <speedyden@xxxxxxxxx> wrote:
> 
> > Hello Neil,
> > 
> > thanks again for spending time on this when you're already swamped, I
> > appreciate it much
> > 
> > the commands look logical for my setup (just a type on the chunk size,
> > needs tobe capital K)
> > I did not dare to fire off the last command last time, but as missing
> > seems to be available for imsm, I re-processed all of the commands
> > again
> > 
> > the Raid0 is created without any trouble (only stating it is already
> > part of an array, confirmed with Y), but the raid5 array won't.
> > After it also stated sdc sdd sde are part of an array, and confirming
> > with Y for the create, it gives the following:
> > 
> > "mdadm: unable to add 'missing' disk to container"
> > I'm using mdadm - v3.2.6 - 25th October 2012.
> > Could it be the 3.2.6 does not support missing for imsm?
> 
> That's weird.  I'm sure I tested it yesterday and it worked.
> Today it doesn't in exactly the way you describe.
> I'll have a poke and see what is happening.

OK I think I figured it out.

Firstly, to create an IMSM array with a missing device, every array in the
container must have the same device missing.
Now you cannot create the RAID0 with a missing device, so you need to create
a RAID5 in it's place instead.
So:

  mdadm -C /dev/md/imsm -e imsm -n 3 /dev/sd[cde]
  mdadm -C /dev/md0 -l 5 -n 4 -c 128K -z 512G missing /dev/sd[cde]

then create the radi5 you want:

  mdadm -C /dev/md1 -l 5 -n 4 -c 128K missing /dev/sd[cde]

That creates the container with 3 devices, and two 4-device arrays each with
one device missing (every array in a container must have the same number of
devices, and must have the same number that are missing).

However the above will crash.  That is the "secondly".

You need the following patch, or you can just collect the latest from
git://neil.brown.name/mdadm/

NeilBrown

commit 1ca5c8e0c74946f4fcd74e97c5f48fba482d9596
Author: NeilBrown <neilb@xxxxxxx>
Date:   Tue Jan 21 09:40:02 2014 +1100

    IMSM: don't crash when creating an array with missing devices.
    
    'missing' devices are in a different list so when collection the
    serial numbers of all devices we need to check both lists.
    
    Signed-off-by: NeilBrown <neilb@xxxxxxx>

diff --git a/super-intel.c b/super-intel.c
index c103ffdd2dd8..f0a7ab5ccc7a 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5210,6 +5210,8 @@ static int create_array(struct supertype *st, int dev_idx)
 		int idx = get_imsm_disk_idx(dev, i, MAP_X);
 
 		disk = get_imsm_disk(super, idx);
+		if (!disk)
+			disk = get_imsm_missing(super, idx);
 		serialcpy(inf[i].serial, disk->serial);
 	}
 	append_metadata_update(st, u, len);

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux