[CentOS] Expanding RAID 10 array, WAS: 40TB File System Recommendations

Wed Apr 13 16:45:37 UTC 2011
Ross Walker <rswwalker at gmail.com>

On Wed, Apr 13, 2011 at 11:19 AM, Emmanuel Noobadmin
<centos.admin at gmail.com> wrote:
> On 4/13/11, Rudi Ahlers <Rudi at softdux.com> wrote:
>>> to expand the array :)
>>
>> I haven't had problems doing it this way yet.
>
> I finally figured out my mistake creating the raid devices and got a
> working RAID 0 on two RAID 1 arrays. But I wasn't able to add another
> RAID 1 component to the array with the error
>
> mdadm: add new device failed for /dev/md/mdr1_3 as 2: Invalid argument
>
> Googling up this indicates that it's the expected result trying to add
> a new device to a RAID 0 array. Could you or anybody else please share
> what's the trick to achieving this?

You can't expand a mdraid raid0.

I believe you can expand a mdraid raid10,5,6, but not raid0.

If you want to use separate raid1 devices instead of mdraid's raid10
implementation then use LVM, add them to a VG then stripe the LVs
across the different PVs.

The only problem with that is restriping existing LVs across new PVs
is difficult to the point that it is often better to create new LVs
with the proper striping. You can do it though using 'lvresize' to
change the stripe width, but it won't give a linear striping for
existing data and the LV will eventually fill the first PVs causing
all data to only be written to the last PV.

I often find it handy to have a "backup" raid1 disk on the system
that's big enough to hold the contents of the largest LV, then dump
the production LV to the backup, blow away the production, recreate
with the new stripe size, then restore the data back. This backup
volume could be an iSCSI volume exported from another server that does
have the capacity if there isn't any in the host.

-Ross