Skip to contentSkip to conversation

md Grow for Raid 5

DISCUSSION John Poirier 7 participants 11 messages Mar 8, 2005 – Mar 10, 2005 MD RAID

lore
Share & tools
lore
#0 lore raw

Greets,
A lot of RAID 5 hardware controllers can grow a RAID 5 array (online capacity expansion). Will this be available in software RAID?

John

#1 lore raw

It actually is available.
I've tested it and it worked fine for me. But taking a backup is highly recommended.
The trick is not to use mdadm, since growing with mdadm is not possible at the moment. Use raid-tools instead.
The program raidreconf comes along with raidtools. This prog takes two raid-tab files as input which describe the array configuration before and after reconfiguration. (See man raidreconf for further details) I've testet growing an array of 3 disks to 4 disks. Having LVM2 grow its volume group along with the raid was another (very tricky) thing...

Greetings,
Frank

Quoted 2 lines · John Poirier

Greets,
A lot of RAID 5 hardware controllers can grow a RAID 5 array (online capacity expansion). Will this be available in software RAID?

#2 lore raw
Quoted 4 lines · Frank Wittig

It actually is available.
I've tested it and it worked fine for me. But taking a backup is highly recommended.
The trick is not to use mdadm, since growing with mdadm is not possible at the moment. Use raid-tools instead.
The program raidreconf comes along with raidtools. This prog takes two raid-tab files as input which describe the array configuration before and after reconfiguration. (See man raidreconf for further details)

I'll second both major points here:

raidreconf does work, but it can fail and leave things completely destroyed (imagine one bad block somewhere after parity was partially migrated), so take a backup.

Given that you're taking a backup already then, creating a new array (with its optimized resync) might be faster if its an online backup.

I'm 2 for 4 now on raidreconf working, with the two failures (sadly) being of the "operator error" variety - raidreconf is picky and fails slow if your disk sizes aren't what it expects, I found. It got to the end and ran out of space on me due to a slightly different "250GB" disk size once. The other was a bad block along the way - I should have done smartctl -t long on all drives prior to resize. Both lessons learned...

-Mike

#3 lore raw

Have you guys seen/tried mdadm 1.90? I am delightfully experiencing the neat issues [read problems] with MY system [sys1], and am too into myself to be able to take on serious other-probs. The doc [which is still a tad lite, NB] has a grow command. Understand that your files exist on/in a filesystem, which has a _size_. Growing RAID and growing fs are two, nonrelated things. But if you want #2, then you have to do both 1 & 2. There is definately more than one way to "skin a cat", so pgms of which you are familiar might be queried first.

Price - 2cents
b-
caveat:
You may not get what you paid for -
but, you always pay for what you get. <-Practise .sig

Quoted 25 lines · Mike Hardy
Quoted 4 lines · Frank Wittig

It actually is available.
I've tested it and it worked fine for me. But taking a backup is highly recommended.
The trick is not to use mdadm, since growing with mdadm is not possible at the moment. Use raid-tools instead.
The program raidreconf comes along with raidtools. This prog takes two raid-tab files as input which describe the array configuration before and after reconfiguration. (See man raidreconf for further details)

I'll second both major points here:

raidreconf does work, but it can fail and leave things completely destroyed (imagine one bad block somewhere after parity was partially migrated), so take a backup.

Given that you're taking a backup already then, creating a new array (with its optimized resync) might be faster if its an online backup.

I'm 2 for 4 now on raidreconf working, with the two failures (sadly) being of the "operator error" variety - raidreconf is picky and fails slow if your disk sizes aren't what it expects, I found. It got to the end and ran out of space on me due to a slightly different "250GB" disk size once. The other was a bad block along the way - I should have done smartctl -t long on all drives prior to resize. Both lessons learned...

(quoted diff) +0 -2
-Mike
-

To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

.

#4 lore raw
Quoted 1 line · berk walker

Have you guys seen/tried mdadm 1.90? I am delightfully experiencing the

I believe the mdadm based grow does not work for raid5, but only for raid0 or raid1. raidreconf is actually capable of adding disks to raid5 and re-laying out the stripes / moving parity blocks, etc

You're very correct about needing to grow the FS after growing the device though. Most FS's have tools for that, or there's LVM...

-Mike

#5 lore raw
Quoted 7 lines · On Tuesday March 8, [email protected] wrote:
Quoted 1 line · berk walker

Have you guys seen/tried mdadm 1.90? I am delightfully experiencing the

I believe the mdadm based grow does not work for raid5, but only for raid0 or raid1. raidreconf is actually capable of adding disks to raid5 and re-laying out the stripes / moving parity blocks, etc

There are different dimensions for growing....
You can make the component devices bigger, or you can add component devices. You can increase storage or you can increase redundancy.

If you replace all the devices in a raid1, raid5, or raid6 with large devices (presumably one at a time allowing for a reconstruct each time) then mdadm will allow you to "grow" the array to make use of the extra space.

mdadm will also allow you to "grow" and raid1 array by adding extra devices. This only increases redundancy, not capacity.

I code to allows you to "grow" a linear array by adding a drive to it. I'm not sure if I have submitted this code.

I plan a raid4 version that organises the data in a linear rather than
a striped fashion. It would be quite simple for mdadm to 'grow' this
sort of array.

All of these do not require moving data around, so they are easy.

Growing a raid5 or raid6 by adding another drive is conceptually possible to do while the array is online, but I have not definite plans to do this (I would like to). Growing a raid5 into a raid6 would also be useful.
These require moving lots of data around, and need to be able to cope with drive failure and system crash.... a fun project..

As has been said, raidreconf does at least some of this off-line.

NeilBrown

#6 lore raw
Quoted 8 lines · Neil Brown

Growing a raid5 or raid6 by adding another drive is conceptually possible to do while the array is online, but I have not definite plans to do this (I would like to). Growing a raid5 into a raid6 would also be useful.
These require moving lots of data around, and need to be able to cope with drive failure and system crash.... a fun project..

EVMS has this already.

It works and is supported (whereas I didn't think raidreconf was). It would be nice to move the EVMS raid5 extension code into the core md.

FYI, I used EVMS briefly and found it to be an excellent toolset. It's a teeny bit rough and a bit OTT for a personal server though so I'm sticking with md/lvm2 for now :)

David

#7 lore raw
In reply to Mike Hardy
Quoted 3 lines · Mike Hardy

You're very correct about needing to grow the FS after growing the device though. Most FS's have tools for that, or there's LVM...

-Mike

I've tested with LVM2 an found, that resizing is not supported at the moment (newest kernel with FC3).
LVM can only grow by adding PVs to the VG. Growing PVs is not supported.
The only way is to export and reimport the VG configuration with vgcfgbackup and vgcfgrestore and to alter the number of physical extends of the grown PV manually.

Greetings,
Frank

#9 lore raw

How does mdadm grow a raid5 array?
Could you please provide an URL to other tools which can perform online capacity expansion of md raid5 arrays?

--
Regards,
Mike T.

Quoted 16 lines · berk walker

Already are, John. mdadm, and two or three others. b-

Quoted 9 lines · John Poirier

Greets,

A lot of RAID 5 hardware controllers can grow a RAID 5 array (online capacity expansion). Will this be available in software RAID?

John

-

#10 lore raw

Mike, check him out, google him. Man is really open, good/talanted, and the author of mdadm.

That being said, the dox for it do seem a bit lean, but at least give it/him a look, ok?
And on other tools, google on that, also. Google is the compuweenies friend - *usually* works for me. [if you need help on whatis google, etc, priv. mail me] b-

Quoted 36 lines · Mike Tran

How does mdadm grow a raid5 array?
Could you please provide an URL to other tools which can perform online capacity expansion of md raid5 arrays?

Signature · 2 lines
Regards,
Mike T.
Quoted 18 lines · berk walker

Already are, John. mdadm, and two or three others. b-

Quoted 10 lines · John Poirier

Greets,

A lot of RAID 5 hardware controllers can grow a RAID 5 array (online capacity expansion). Will this be available in software RAID?

John

-

-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

.