* Expanding array by changing disks (one by one)
@ 2005-04-14 10:11 Laurent CARON
2005-04-14 10:15 ` Andy Smith
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Laurent CARON @ 2005-04-14 10:11 UTC (permalink / raw)
To: Linux
Hello,
We are in the process of increasing the size our RAID Arrays as our
storage needs increase.
I've got 2 solutions for this:
- Copy the data over a new array and replace the disks
- Replace each disk (one after the other(after resync)) of the existing
array with a bigger one.
Start:
- Array is ok
- Remove 1 disk
- Array is degraded
- Add a bigger disk
- Resync
- Remove another disk
- Array is degraded
- Add a bigger disk
- Resync
.....
Would this be the 'state of the art' way ?
Will the filesystem cope with it?
Is my mind completely broken?
Thanks for your help.
Laurent
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Expanding array by changing disks (one by one)
2005-04-14 10:11 Expanding array by changing disks (one by one) Laurent CARON
@ 2005-04-14 10:15 ` Andy Smith
2005-04-14 11:02 ` Gordon Henderson
2005-04-14 11:04 ` David Greaves
2 siblings, 0 replies; 5+ messages in thread
From: Andy Smith @ 2005-04-14 10:15 UTC (permalink / raw)
To: Linux
[-- Attachment #1: Type: text/plain, Size: 390 bytes --]
On Thu, Apr 14, 2005 at 12:11:20PM +0200, Laurent CARON wrote:
> Hello,
>
> We are in the process of increasing the size our RAID Arrays as our
> storage needs increase.
[...]
> - Replace each disk (one after the other(after resync)) of the existing
> array with a bigger one.
I'd also like to know (but only out of interest) if this will work
specifically with a RAID5.
[-- Attachment #2: Type: application/pgp-signature, Size: 187 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Expanding array by changing disks (one by one)
2005-04-14 10:11 Expanding array by changing disks (one by one) Laurent CARON
2005-04-14 10:15 ` Andy Smith
@ 2005-04-14 11:02 ` Gordon Henderson
2005-04-14 15:08 ` Mike Hardy
2005-04-14 11:04 ` David Greaves
2 siblings, 1 reply; 5+ messages in thread
From: Gordon Henderson @ 2005-04-14 11:02 UTC (permalink / raw)
To: Linux
On Thu, 14 Apr 2005, Laurent CARON wrote:
> Hello,
>
> We are in the process of increasing the size our RAID Arrays as our
> storage needs increase.
>
> I've got 2 solutions for this:
>
> - Copy the data over a new array and replace the disks
Do this! You know it makes sense. If nothing else, it'll make sure you
have an archive of the data. Do verify the copy before you replace the
disks too.
> - Replace each disk (one after the other(after resync)) of the existing
> array with a bigger one.
>
> Start:
> - Array is ok
> - Remove 1 disk
> - Array is degraded
> - Add a bigger disk
> - Resync
> - Remove another disk
> - Array is degraded
> - Add a bigger disk
> - Resync
> .....
>
> Would this be the 'state of the art' way ?
You would have to guarantee that each disk had zero surface defects before
you started this. Use badblocks (or dd) to do a surface scan of each disk.
One bad block and you'll be in the 2-disk failure mode which will likely
cause loss of all data.
> Will the filesystem cope with it?
Firstly, will the RAID cope with it, and my understanding is that it might
not - initially. When you put in a new, bigger disk, it will only use the
same number of blocks as the disk you are replacing it had.
So after doing all the disks, the array size won't have changed!
So next you'd need to look at the grow the array mechanism, and as I
understand it, this is supported in the 2.6 kernel and mdadm, but the man
page is short on examples, but I'm sure someone here might fill in the
details.
Then you'd have to grow the filesystem under it.
> Is my mind completely broken?
Well - not really, but IMO, doing it the individual disk swapping way is
just too prone to errors and failure. I'd backup the data, replace the
drives and restore it.
And even if you do go down this route, I'd backup my data first anyway!
(And then, since you have a backup, you have nothing to lose doing it the
multiple disk swapping way, so write back and let us know if it worked :)
Good luck!
Gordon
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Expanding array by changing disks (one by one)
2005-04-14 10:11 Expanding array by changing disks (one by one) Laurent CARON
2005-04-14 10:15 ` Andy Smith
2005-04-14 11:02 ` Gordon Henderson
@ 2005-04-14 11:04 ` David Greaves
2 siblings, 0 replies; 5+ messages in thread
From: David Greaves @ 2005-04-14 11:04 UTC (permalink / raw)
To: Laurent CARON; +Cc: Linux
Laurent CARON wrote:
> Hello,
>
> We are in the process of increasing the size our RAID Arrays as our
> storage needs increase.
Hi,
I'm no expert but I'll bounce some thoughts back at you...
>
> I've got 2 solutions for this:
>
> - Copy the data over a new array and replace the disks
pros:
sane and minimal risk of data loss since you don't delete data until the
new one is up.
quickest solution (in manpower, elapsed time and system outages)
cons:
doesn't test Neils grow mode in mdadm (without which none of this would
be possible)
> - Replace each disk (one after the other(after resync)) of the
> existing array with a bigger one.
and the corollorary of sane would be... <joke>
>
> Start:
> - Array is ok
> - Remove 1 disk
> - Array is degraded
> - Add a bigger disk
> - Resync
> - Remove another disk
> - Array is degraded
> - Add a bigger disk
> - Resync
> .....
>
This seems like it would work with mdadm's shiny new(?) grow command.
It looks from the man page like you use the grow command *after*
changing out all the disks; yes?
Shiny and new means you need a reliable backup.
And this is likely to be slow - 1 resync per disk - and needs a system
shutdown/outage for each disk swapped (assuming not hot-swap-able)
If you do have hot-swap then this seems like quite a nice option (no
outages)
Mad speculative question ...
Would doing this work:
- add new big disk
- mdadm --remove a disk
- dd if=<removed disk> of=<new disk>
- mdadm -add new disk?
- remove small disk
if so it'd be a lot quicker than a resync each time...
> Would this be the 'state of the art' way ?
Have you seen EVMS? It has the ability to add devices to a raid5 array.
I'd class that as state of the art since you aren't 'throwing away' the
smaller disks.
> Will the filesystem cope with it?
yes assuming it has a growfs.
>
> Is my mind completely broken?
not yet - let us know after you try it...
David
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Expanding array by changing disks (one by one)
2005-04-14 11:02 ` Gordon Henderson
@ 2005-04-14 15:08 ` Mike Hardy
0 siblings, 0 replies; 5+ messages in thread
From: Mike Hardy @ 2005-04-14 15:08 UTC (permalink / raw)
To: linux-raid
Gordon Henderson wrote:
> On Thu, 14 Apr 2005, Laurent CARON wrote:
>>
>>- Copy the data over a new array and replace the disks
>
>
> Do this! You know it makes sense. If nothing else, it'll make sure you
> have an archive of the data. Do verify the copy before you replace the
> disks too.
Definitely make a backup, and once you do that the rest is just testing
anyway, isn't it?
>>- Replace each disk (one after the other(after resync)) of the existing
>>array with a bigger one.
>
> You would have to guarantee that each disk had zero surface defects before
> you started this. Use badblocks (or dd) to do a surface scan of each disk.
> One bad block and you'll be in the 2-disk failure mode which will likely
> cause loss of all data.
Alternatively, you could do a round of SMART long tests via smartctl.
If you have one bad block you will be in 2-disk failure mode, but this
will not result in loss of all data. It will result in loss of whichever
file had the bad block in it. Even then, there are now tools (namely a
script I've posted a couple times) that can calculate the contents of a
given parity block or disk block just from the disk contents (while the
array is offline) so its possible to manually correct single block
failures as long as the rest of the blocks in the stripe are okay.
That solves the most usual scenario, albeit via a process that is pretty
ugly. Should make you feel safer if you feel like experimenting though.
The real takeaway is that making a backup, verifying it, and then doing
your maintenance is going to be the fastest and safest way to do this,
even if the disk-by-disk swap / mdadm grow way works
-Mike
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-04-14 15:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-14 10:11 Expanding array by changing disks (one by one) Laurent CARON
2005-04-14 10:15 ` Andy Smith
2005-04-14 11:02 ` Gordon Henderson
2005-04-14 15:08 ` Mike Hardy
2005-04-14 11:04 ` David Greaves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).