# mdadm problem adding disc to raid  6

## xibo

hello,

i m trying to expand a raid 6 array by a disc. i partitioned it to have a single partition of type 0xfd, like all already present discs of the array and have the same partition size, and successfully added the new partition to the array as a spare. however, when i try to grow the array, mdadm aborts saying

 *Quote:*   

> 
> 
> mdadm --grow --raid-devices=7 (it's having 6 active discs plus 1 spare)
> 
>        mdadm: this change will reduce the size of the array.
> ...

 

i tryed reducing array-size by like 30% and tryed growing again, but it still doesn't work.

maybe usefull information:

 *Quote:*   

> 
> 
> mdadm --detail
> 
> /dev/md0:
> ...

 

----------

## richard.scott

does your kernel have the support option activated to grow a raid6 device?

Try this:

```
mdadm --grow /dev/md0 --size=max
```

...and see if it works.

----------

## xibo

 *richard.scott wrote:*   

> Try this:
> 
> ```
> mdadm --grow /dev/md0 --size=max
> ```
> ...

 

the command successfully terminates, but it only resets the amount of blocks used of each device ( instead of the number of active devices ).

 *richard.scott wrote:*   

> does your kernel have the support option activated to grow a raid6 device?

 

i don't have the option availible in menuconfig, nor is disabled in .config . i remember having seen it in the past though... did it become too unstable or do i need a special patch or something like that? ( i thought it was integrated to raid6 support now )

 *Quote:*   

> 
> 
> cat /usr/src/linux/.config | grep CONFIG_MD --after-context=25
> 
> CONFIG_MD=y                           
> ...

 

----------

## richard.scott

I've just re-read this (now I'm awake):

```
Number Major Minor RaidDevice State

0 8 113 0 active sync /dev/sdh1

1 8 129 1 active sync /dev/sdi1

2 8 81 2 active sync /dev/sdf1

3 8 49 3 active sync /dev/sdd1

4 8 65 4 active sync /dev/sde1

5 8 97 5 active sync /dev/sdg1

6 8 33 - spare /dev/sdc1
```

You have 6 disks, and a spare... this means that you have 4 usable disks, two for parity and 1 spare. totalling the 7 you have in your system.

Your array looks to be at its max size, as you can't use a spare as its a spare.

Rich

----------

## xibo

That's what I want to change: reshape the array to have 5 data and 2 parity devices...

----------

## richard.scott

What you had before should have worked:

```
mdadm --grow /dev/md0 --raid-disks=7
```

I found it on this page:

http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/

Did you remember to include the "/dev/md0" as you haven't listed that in your output?

Rich

----------

## xibo

I just found out it seems to be a mdadm-3.1.1 bug: http://marc.info/?l=linux-raid&m=125920566107815&w=2

recompiling right now...

----------

