# Software RAID 5: how can I enlarge it?

## KlausBreuer

Hi!

So, I finally managed to buy five nice 250MB IDE drives, and two IDE controllers in order to set up a nice software RAID-5 array with 1TB (wheee!) of space.

Having never done this, I eagerly scanned the docs. And found out that I should NOT use master/slave setups.

But... currently I cannot afford another controller (time, not money). Thus I'd start with 4 drives (meaning I'd 'only' have 750GB of space).

In the near future, however, I'd be able to get another controller, and thus update the number of disks in my system. 

Can this be done? If so, how easily can it be done?

I'm using an AMD 64 3500+ with 2 GB RAM and 2x IDE controlers (Promise Ultra 133 TX2).

advTHANKSance!

Klaus

----------

## oizone

I've used raidreconf to grow my raid5 array, currently 8x160Gb ATA disk.

raidreconf is in sys-fs/raidtools

If you have /etc/raidtab just create a new copy (fe. /etc/raidtab.new) with the new disk added and run

```
raidreconf -o /etc/raidtab -n /etc/raidtab.new -m /dev/md0
```

assuming your array is /dev/md0

If you don't have an existing raidtab you can propably do,

```
raidreconf -i /dev/sda -n /etc/raidtab -m /dev/md0
```

assuming /dev/sda is part of your existing array

mdadm also has a grow option -G , but I haven't tried it.

----------

## cold

How secure is this or in other words, How big the risk that I lose the data from my RAID5 aray When I enlagre it this way?

----------

## KlausBreuer

Well, I can't seem to use the -grow option in mdadm:

  Grow:   Grow (or shrink) an array, or otherwise reshape it in some way.  Currently

              supported  growth options including changing the active size of componenet

              devices in RAID level 1/4/5/6 and changing the number of active devices in

              RAID1.

But I can't seem to be able to stop my RAID array, either:

```
# raidstop /dev/md0

/dev/md0: Device or resource busy
```

and

```
# raidreconf -o /etc/raidtab -n /etc/raidtab.new -m /dev/md0

Working with device /dev/md0

Parsing /etc/raidtab

Parsing /etc/raidtab.new

/dev/md0: array is active -- run raidstop first.

reconfiguration failed
```

Any idea what I'm doing wrong? After all, root should be able to shut down an array...

----------

## Kaapeli

It says device is busy, is it still mounted?

----------

## KlausBreuer

Ummmm...  :Embarassed: 

Thanks!

----------

## KlausBreuer

Aaaaaargh!   :Shocked: 

Er... um... maybe I'm just completely tired (it is 3:30am here), but...

I ran raidreconf with the correct config over the weekend - it took a very long time.

When I looked at my system again, it said that all had gone well, and the array now had (many more) blocks than before.

I mounted it, looked at it via KInfoCenter - and got the exact same size as before: 699.2 GB.

Whoops. Logged out and back in: same thing.

Can't be, though. Look at this:

 *Quote:*   

> # cat /proc/mdstat
> 
> Personalities : [raid5]
> 
> md0 : active raid5 hdf[5] hdl[4] hdk[3] hdj[2] hdi[1] hde[0]
> ...

 

See - it contains the new drive, hdf. And the size looks about right: 1.1 TB

Or the dmesg section:

 *Quote:*   

> md: raidstart(pid 5919) used deprecated START_ARRAY ioctl. This will not be supported beyond 2.6
> 
> md: autorun ...
> 
> md: considering hdf ...
> ...

 

Finally, 

 *Quote:*   

>  # cat /etc/raidtab.new
> 
> raiddev /dev/md0
> 
>         raid-level      5
> ...

 

(Yes, it seems to be using raidtab.new now - exchanging raidtab and raistab.new caused the raid to refuse service)

I definitively have 6x250 GB drives active now... but what's with the KInfoCenter? Or did I screw up after all?

Full of confusion and appreciating any help,

Klaus

----------

## oizone

You will also need to extend the filesystem. Just

```

resize2fs /dev/md0

```

----------

