linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* adding a disk smaller than the array size
@ 2004-10-13 20:30 kclair
  2004-10-13 20:54 ` maarten
  0 siblings, 1 reply; 6+ messages in thread
From: kclair @ 2004-10-13 20:30 UTC (permalink / raw)
  To: linux-raid

Hello,

I am trying to figure out how I can add a disk that is smaller than
the size of the raid array to the array.  I'm confused about whether
simply rebuilding the array with the new disk will work?

Thanks in advance for any advice,
Kristina

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: adding a disk smaller than the array size
  2004-10-13 20:30 adding a disk smaller than the array size kclair
@ 2004-10-13 20:54 ` maarten
  2004-10-13 21:06   ` kclair
  0 siblings, 1 reply; 6+ messages in thread
From: maarten @ 2004-10-13 20:54 UTC (permalink / raw)
  To: linux-raid

On Wednesday 13 October 2004 22:30, kclair wrote:
> Hello,
>
> I am trying to figure out how I can add a disk that is smaller than
> the size of the raid array to the array.  I'm confused about whether
> simply rebuilding the array with the new disk will work?

Well that is surely a rather incomplete question, since you do not even 
mention which raid level you're talking about.

That said, I don't think this is possible, in most cases. Raid 5 cannot use a 
disk which is smaller than its peers AFAIK, and neither can raid 1.
Obviously too, since they cannot be expected to just 'throw away' part of 
their data...
Whether raid 0 and/or JBOD can I don't know; sure they can be _built_ with all 
sorts of differing drive sizes, but I seem to recall those levels are not 
supported by any on- or offline resizing tool (and they are by definition not 
fault-tolerant so the issue of _replacing_ a drive is thereby moot...).

If you're looking for trouble / complexity you could consider to make a raid 0 
array out of two smaller drives, and add that combo to your existing raid 
set.  Don't know if raid 5 will accept that, but raid 1 will.  But such 
solutions will probably not contribute to stability and reliability... 

Hope that answered your question,
Maarten

> Thanks in advance for any advice,
> Kristina
> -
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
When I answered where I wanted to go today, they just hung up -- Unknown


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: adding a disk smaller than the array size
  2004-10-13 20:54 ` maarten
@ 2004-10-13 21:06   ` kclair
  2004-10-13 22:08     ` maarten
  0 siblings, 1 reply; 6+ messages in thread
From: kclair @ 2004-10-13 21:06 UTC (permalink / raw)
  To: maarten; +Cc: linux-raid

I am using raid 1 - sorry for the incomplete information.

The situation is that the array was comprised of two disks, one
slightly smaller than the other.  I did need to remove the smaller of
the disks to fix a partition problem, but now I am unable to add it
back, presumably because the size of the array grew to the size of the
larger disk when the smaller disk was removed?

It is my understanding that the size of the array is not equal to the
amount of data that is actually on the disks.  Is this not true?

I tried to resize the array using mdadm, but that did not work (I got
an error saying the file exists).

The array now only consists of the one larger disk.  If I try to
reassemble the array with both disks, will the information from the
larger disk get synced to the other disk?  Or is there something else
I need to do?

Thanks,
Kristina

On Wed, 13 Oct 2004 22:54:22 +0200, maarten <maarten@ultratux.net> wrote:
> On Wednesday 13 October 2004 22:30, kclair wrote:
> > Hello,
> >
> > I am trying to figure out how I can add a disk that is smaller than
> > the size of the raid array to the array.  I'm confused about whether
> > simply rebuilding the array with the new disk will work?
> 
> Well that is surely a rather incomplete question, since you do not even
> mention which raid level you're talking about.
> 
> That said, I don't think this is possible, in most cases. Raid 5 cannot use a
> disk which is smaller than its peers AFAIK, and neither can raid 1.
> Obviously too, since they cannot be expected to just 'throw away' part of
> their data...
> Whether raid 0 and/or JBOD can I don't know; sure they can be _built_ with all
> sorts of differing drive sizes, but I seem to recall those levels are not
> supported by any on- or offline resizing tool (and they are by definition not
> fault-tolerant so the issue of _replacing_ a drive is thereby moot...).
> 
> If you're looking for trouble / complexity you could consider to make a raid 0
> array out of two smaller drives, and add that combo to your existing raid
> set.  Don't know if raid 5 will accept that, but raid 1 will.  But such
> solutions will probably not contribute to stability and reliability...
> 
> Hope that answered your question,
> Maarten
> 
> > Thanks in advance for any advice,
> > Kristina
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> --
> When I answered where I wanted to go today, they just hung up -- Unknown
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: adding a disk smaller than the array size
  2004-10-13 21:06   ` kclair
@ 2004-10-13 22:08     ` maarten
  2004-10-13 22:46       ` Jim Paris
  0 siblings, 1 reply; 6+ messages in thread
From: maarten @ 2004-10-13 22:08 UTC (permalink / raw)
  To: linux-raid

On Wednesday 13 October 2004 23:06, kclair wrote:
> I am using raid 1 - sorry for the incomplete information.
>
> The situation is that the array was comprised of two disks, one
> slightly smaller than the other.  I did need to remove the smaller of
> the disks to fix a partition problem, but now I am unable to add it
> back, presumably because the size of the array grew to the size of the
> larger disk when the smaller disk was removed?

Mmm. That shouldn't happen if it's the exact same disk.  However, maybe the 
size _did_ get just a tiny bit smaller somehow, possibly due to a bad 
sector(?) or due to a different C/H/S(*) mapping than before.  Can you see 
how big the size is exactly using 'fdisk -l' and compare the two drives ?

(*) 16 heads, 400 cylinders may appear to be just as big as 256 heads, 25 
cylinders but in my experience there can be a small difference despite what 
the math says.  Dunno where that comes from (maybe I'm just dreaming).

I've never heard of an array growing out of its own accord, so that can not 
possibly be the reason, AFAIK.

> It is my understanding that the size of the array is not equal to the
> amount of data that is actually on the disks.  Is this not true?

Don't understand what you're saying here, but you build arrays out of 
partitions, and the array doesn't care whether there is data there or not. So 
no, the size of the array is indeed not equal to the data on it.
But that makes no difference, since not the actual used data is mirrored, but 
the entire partition, including any and all unused blocks with it. 

> I tried to resize the array using mdadm, but that did not work (I got
> an error saying the file exists).
>
> The array now only consists of the one larger disk.  If I try to
> reassemble the array with both disks, will the information from the
> larger disk get synced to the other disk?  Or is there something else
> I need to do?

Well... Can you post the output of 'fdisk -l' for both those drives here ?
And maybe throw in a 'cat /proc/mdstat' or 'mdadm --detail /dev/md?' for good 
measure.

And failing everything, you could (maybe) clone the array-disk to the empty 
smaller one, run fsck to fix the partition size (but I'm not totally sure it 
does, so that remains doubtful), reverse the roles of the two disks and then 
add the -now free- larger disk to the array. But that would be a last resort.
I cannot vouch for how md copes with the few missing sectors, and neither how 
the filesystem reacts, so you'd better not try that without good testing.

Maarten

> Thanks,
> Kristina

-- 
When I answered where I wanted to go today, they just hung up -- Unknown


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: adding a disk smaller than the array size
  2004-10-13 22:08     ` maarten
@ 2004-10-13 22:46       ` Jim Paris
  2004-10-14 20:29         ` kclair
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Paris @ 2004-10-13 22:46 UTC (permalink / raw)
  To: linux-raid

> And failing everything, you could (maybe) clone the array-disk to the empty 
> smaller one, run fsck to fix the partition size (but I'm not totally sure it 
> does, so that remains doubtful), reverse the roles of the two disks and then 
> add the -now free- larger disk to the array. But that would be a last resort.
> I cannot vouch for how md copes with the few missing sectors, and neither how 
> the filesystem reacts, so you'd better not try that without good testing.

Or just do this same thing at the filesystem level.

Right now you have md0 with one missing disk.  Use your new disk to
create md1 with one missing disk.  Create filesystem on md1, and copy
files with e.g. tar, rsync, etc.  Then get rid of md0 and add that
drive to md1.

-jim

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: adding a disk smaller than the array size
  2004-10-13 22:46       ` Jim Paris
@ 2004-10-14 20:29         ` kclair
  0 siblings, 0 replies; 6+ messages in thread
From: kclair @ 2004-10-14 20:29 UTC (permalink / raw)
  To: Jim Paris, linux-raid

On Wed, 13 Oct 2004 18:46:43 -0400, Jim Paris <jim@jtan.com> wrote:
> > And failing everything, you could (maybe) clone the array-disk to the empty
> > smaller one, run fsck to fix the partition size (but I'm not totally sure it
> > does, so that remains doubtful), reverse the roles of the two disks and then
> > add the -now free- larger disk to the array. But that would be a last resort.
> > I cannot vouch for how md copes with the few missing sectors, and neither how
> > the filesystem reacts, so you'd better not try that without good testing.
> 
> Or just do this same thing at the filesystem level.
> 
> Right now you have md0 with one missing disk.  Use your new disk to
> create md1 with one missing disk.  Create filesystem on md1, and copy
> files with e.g. tar, rsync, etc.  Then get rid of md0 and add that
> drive to md1.
> 
> -jim
> 

Thanks for all the info and the suggestions.  The key factor here was
that I could not just build an array with one disk containing the data
and one unformatted disk and hope they would sync up.  I followed
Jim's advice successfully ... except that mdadm reports that the new
array is State: dirty.
But at least the data is accessible once again!

Kristina

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-10-14 20:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-13 20:30 adding a disk smaller than the array size kclair
2004-10-13 20:54 ` maarten
2004-10-13 21:06   ` kclair
2004-10-13 22:08     ` maarten
2004-10-13 22:46       ` Jim Paris
2004-10-14 20:29         ` kclair

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).