adding a disk smaller than the array size
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
Quoted 5 lines · kclair
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
Quoted 6 lines
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
When I answered where I wanted to go today, they just hung up -- Unknown
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
Quoted 42 lines · maarten
Quoted 5 lines · kclair
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,
MaartenQuoted 6 lines
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 [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · kclair
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.
Quoted 2 lines
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.
Quoted 7 lines
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
Quoted 2 lines
Thanks,
Kristina
Signature · 1 line
When I answered where I wanted to go today, they just hung up -- Unknown
Quoted 6 lines
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
Quoted 7 lines · Jim Paris
Quoted 6 lines
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.
Quoted 9 lines
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