* Online resize @ 2008-03-11 9:19 Wayne Gemmell 2008-03-11 11:12 ` Robin Hill 2008-04-29 1:00 ` Neil Brown 0 siblings, 2 replies; 13+ messages in thread From: Wayne Gemmell @ 2008-03-11 9:19 UTC (permalink / raw) To: linux-raid Hi all I'd like to do an online resize for my RAID5 drives now that I've upgraded them to 500GB drives. Now I'm a bit stuck. I assume the steps would be the following. 1) Resize partitions 2) Drop EXT3 journal 3) run e2resize 4) Recreate journal. Are there any raid specific things I have to do to get this to work. Am I on the right track? -- Regards Wayne ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Online resize 2008-03-11 9:19 Online resize Wayne Gemmell @ 2008-03-11 11:12 ` Robin Hill 2008-03-11 12:44 ` Wayne Gemmell 2008-04-29 1:00 ` Neil Brown 1 sibling, 1 reply; 13+ messages in thread From: Robin Hill @ 2008-03-11 11:12 UTC (permalink / raw) To: linux-raid [-- Attachment #1: Type: text/plain, Size: 1195 bytes --] On Tue Mar 11, 2008 at 11:19:55AM +0200, Wayne Gemmell wrote: > Hi all > > I'd like to do an online resize for my RAID5 drives now that I've upgraded > them to 500GB drives. Now I'm a bit stuck. I assume the steps would be the > following. > > 1) Resize partitions > 2) Drop EXT3 journal > 3) run e2resize > 4) Recreate journal. > > Are there any raid specific things I have to do to get this to work. Am I on > the right track? > Sort of. The steps you'll need are: 1) Resize partitions (usually a drop & recreate step - this doesn't affect the data though). 2) Force the OS to be aware of the new partition sizes - either a reboot or using partprobe. 3) Grow the array (mdadm --grow) - check the manual page for details. 4) Resize the filesystem (resize2fs). There shouldn't be any need to drop & recreate the journal (I've never done anyway - I guess it may be needed if you want to resize it). HTH, Robin -- ___ ( ' } | Robin Hill <robin@robinhill.me.uk> | / / ) | Little Jim says .... | // !! | "He fallen in de water !!" | [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Online resize 2008-03-11 11:12 ` Robin Hill @ 2008-03-11 12:44 ` Wayne Gemmell 2008-03-11 14:58 ` Robin Hill 0 siblings, 1 reply; 13+ messages in thread From: Wayne Gemmell @ 2008-03-11 12:44 UTC (permalink / raw) To: linux-raid Well that didn't go so well On Tuesday 11 March 2008 13:12:19 Robin Hill wrote: > 2) Force the OS to be aware of the new partition sizes - either a > reboot or using partprobe. > 3) Grow the array (mdadm --grow) - check the manual page for details. I ran partprobe and then mdadm --grow --size=max /dev/md4 and nothing happened. Then I decided to reboot thinking that partprobe hadn't picked up that change and now it says that sda6 doesn't have a superblock. Any ideas what went wrong? > 4) Resize the filesystem (resize2fs). -- Regards Wayne -- 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] 13+ messages in thread
* Re: Online resize 2008-03-11 12:44 ` Wayne Gemmell @ 2008-03-11 14:58 ` Robin Hill 2008-03-12 7:27 ` Wayne Gemmell 2008-03-12 8:04 ` Michael Tokarev 0 siblings, 2 replies; 13+ messages in thread From: Robin Hill @ 2008-03-11 14:58 UTC (permalink / raw) To: linux-raid [-- Attachment #1: Type: text/plain, Size: 1131 bytes --] On Tue Mar 11, 2008 at 02:44:17PM +0200, Wayne Gemmell wrote: > Well that didn't go so well > > On Tuesday 11 March 2008 13:12:19 Robin Hill wrote: > > 2) Force the OS to be aware of the new partition sizes - either a > > reboot or using partprobe. > > 3) Grow the array (mdadm --grow) - check the manual page for details. > I ran partprobe and then mdadm --grow --size=max /dev/md4 and nothing > happened. Then I decided to reboot thinking that partprobe hadn't picked up > that change and now it says that sda6 doesn't have a superblock. Any ideas > what went wrong? > What version metadata are you using? I'm not sure how 1.0 will handle partition resizes but any other should certainly be okay. Have you tried running mdadm -E on each of the component partitions? I assume the new partitions are starting from the same position as the old ones? Cheers, Robin -- ___ ( ' } | Robin Hill <robin@robinhill.me.uk> | / / ) | Little Jim says .... | // !! | "He fallen in de water !!" | [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Online resize 2008-03-11 14:58 ` Robin Hill @ 2008-03-12 7:27 ` Wayne Gemmell 2008-03-12 7:46 ` Wayne Gemmell 2008-03-12 8:04 ` Michael Tokarev 1 sibling, 1 reply; 13+ messages in thread From: Wayne Gemmell @ 2008-03-12 7:27 UTC (permalink / raw) To: linux-raid On Tuesday 11 March 2008 16:58:32 Robin Hill wrote: > What version metadata are you using? I'm not sure how 1.0 will handle > partition resizes but any other should certainly be okay. I'm not sure, the version in mdadm -E is 00.90.00. Is that what your talking about? They were done at the same time. > Have you tried running mdadm -E on each of the component partitions? Yes, It just says "no md superblock detected on /dev/sda6". Same with the rest. > I assume the new partitions are starting from the same position as the old ones? Yes, I just dropped the partition and made a new one in place. -- Regards Wayne -- 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] 13+ messages in thread
* Re: Online resize 2008-03-12 7:27 ` Wayne Gemmell @ 2008-03-12 7:46 ` Wayne Gemmell 0 siblings, 0 replies; 13+ messages in thread From: Wayne Gemmell @ 2008-03-12 7:46 UTC (permalink / raw) To: linux-raid On Wednesday 12 March 2008 09:27:31 Wayne Gemmell wrote: > On Tuesday 11 March 2008 16:58:32 Robin Hill wrote: > > What version metadata are you using? I'm not sure how 1.0 will handle > > partition resizes but any other should certainly be okay. > > I'm not sure, the version in mdadm -E is 00.90.00. Is that what your > talking about? They were done at the same time. Just to clarify this I ran mdadm -E on a partition in a working array that was done at the same time assuming that they are the same. -- Regards Wayne -- 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] 13+ messages in thread
* Re: Online resize 2008-03-11 14:58 ` Robin Hill 2008-03-12 7:27 ` Wayne Gemmell @ 2008-03-12 8:04 ` Michael Tokarev 2008-03-12 9:14 ` Wayne Gemmell 2008-03-12 9:31 ` Robin Hill 1 sibling, 2 replies; 13+ messages in thread From: Michael Tokarev @ 2008-03-12 8:04 UTC (permalink / raw) To: linux-raid Robin Hill wrote: > On Tue Mar 11, 2008 at 02:44:17PM +0200, Wayne Gemmell wrote: > >> Well that didn't go so well >> >> On Tuesday 11 March 2008 13:12:19 Robin Hill wrote: >>> 2) Force the OS to be aware of the new partition sizes - either a >>> reboot or using partprobe. >>> 3) Grow the array (mdadm --grow) - check the manual page for details. >> I ran partprobe and then mdadm --grow --size=max /dev/md4 and nothing >> happened. Then I decided to reboot thinking that partprobe hadn't picked up >> that change and now it says that sda6 doesn't have a superblock. Any ideas >> what went wrong? >> > What version metadata are you using? I'm not sure how 1.0 will handle > partition resizes but any other should certainly be okay. Have you > tried running mdadm -E on each of the component partitions? I assume > the new partitions are starting from the same position as the old ones? Robin, you're completely wrong here. Only metadata at the START of the partition will work here. Which is either 1.1 or 1.2, but NOT 1.0 or 0.90, - which is at the END of the partition. When the end of the partition goes away, the superblock becomes "orphan" somewhere inside the partition, and can't be found anymore. What should be done currently is: a) re-create the array with new partitions, with THE SAME DISK ORDER, METADATA VERSION AND CHUNK SIZE as it was before. b) restore partitions to the EXACT size as they were before, and start from scratch /mjt ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Online resize 2008-03-12 8:04 ` Michael Tokarev @ 2008-03-12 9:14 ` Wayne Gemmell 2008-03-12 9:38 ` Michael Tokarev 2008-03-12 9:31 ` Robin Hill 1 sibling, 1 reply; 13+ messages in thread From: Wayne Gemmell @ 2008-03-12 9:14 UTC (permalink / raw) To: linux-raid On Wednesday 12 March 2008 10:04:56 you wrote: > a) re-create the array with new partitions, with THE SAME DISK ORDER, > METADATA VERSION AND CHUNK SIZE as it was before. Is this possible without loosing data? > > b) restore partitions to the EXACT size as they were before, and > start from scratch Thats easy enough. I'll do that now. -- Regards Wayne ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Online resize 2008-03-12 9:14 ` Wayne Gemmell @ 2008-03-12 9:38 ` Michael Tokarev 2008-03-12 11:17 ` Wayne Gemmell 0 siblings, 1 reply; 13+ messages in thread From: Michael Tokarev @ 2008-03-12 9:38 UTC (permalink / raw) To: wayne; +Cc: linux-raid Wayne Gemmell wrote: > On Wednesday 12 March 2008 10:04:56 you wrote: >> a) re-create the array with new partitions, with THE SAME DISK ORDER, >> METADATA VERSION AND CHUNK SIZE as it was before. > Is this possible without loosing data? Yes. But it's unreliable, sorta. Too easy to screw things up, that is. >> b) restore partitions to the EXACT size as they were before, and >> start from scratch > Thats easy enough. I'll do that now. And now, the original question comes up again: what to do, how to perform the actual resize of the raid array... To be fair, I don't really know. I always used my own tiny program to assist me in a situation like this - to back up and restore v0.90 linux raid superblocks. It's available at http://www.corpit.ru/mjt/mdsuper.c . Here's how I use it: First, save the original superblocks in files: for f in sd{a,b,c,d,e}1; do ./mdsuper read /dev/$f > $f done this instructs mdsuper to read the superblock (v0.90 only!) and write it to standard out. This has to be done while the array (on original partitions) is STOPPED. Now, resize the partitions, reboot if necessary (for the kernel to recognize the new sizes). You can save a dump of your current partitions using `sfdisk -d' (redirect its output to a file as with mdsuper) - just in case if something goes wrong. At this point, your array is unaccessible - mdadm will tell you that it can't find the superblocks. But we have the superblocks saved - so we only need to restore them back: for f in sd{a,b,c,d,e}1; do ./mdsuper write /dev/$f < $f done (note the redirection is opposite!, and read was changed to write!). Now, try to assemble the array - it should be here. We just moved (actually copied) the superblock from the now-middle-of-partitions to the end, where it should be, and mdadm is now able to find it. The array is still of the old size - but now mdadm --grow will work. That's basically it. Just watch the mdsuper invocation. /mjt ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Online resize 2008-03-12 9:38 ` Michael Tokarev @ 2008-03-12 11:17 ` Wayne Gemmell 0 siblings, 0 replies; 13+ messages in thread From: Wayne Gemmell @ 2008-03-12 11:17 UTC (permalink / raw) To: Michael Tokarev; +Cc: linux-raid On Wednesday 12 March 2008 11:38:25 Michael Tokarev wrote: > Wayne Gemmell wrote: > > On Wednesday 12 March 2008 10:04:56 you wrote: > >> a) re-create the array with new partitions, with THE SAME DISK ORDER, > >> METADATA VERSION AND CHUNK SIZE as it was before. > > > > Is this possible without loosing data? > > Yes. But it's unreliable, sorta. Too easy to screw things up, that is. Thankfully I didn't need to do this. Resizing the partitions fixed that. And now for the dangerous (looking) part. > And now, the original question comes up again: what to do, how to > perform the actual resize of the raid array... > > To be fair, I don't really know. I always used my own tiny program > to assist me in a situation like this - to back up and restore > v0.90 linux raid superblocks. It's available at > http://www.corpit.ru/mjt/mdsuper.c . Here's how I use it: > > First, save the original superblocks in files: > > for f in sd{a,b,c,d,e}1; do > ./mdsuper read /dev/$f > $f > done > > this instructs mdsuper to read the superblock (v0.90 only!) and > write it to standard out. This has to be done while the array > (on original partitions) is STOPPED. > > Now, resize the partitions, reboot if necessary (for the kernel > to recognize the new sizes). You can save a dump of your current > partitions using `sfdisk -d' (redirect its output to a file as > with mdsuper) - just in case if something goes wrong. > > At this point, your array is unaccessible - mdadm will tell you > that it can't find the superblocks. But we have the superblocks > saved - so we only need to restore them back: > > for f in sd{a,b,c,d,e}1; do > ./mdsuper write /dev/$f < $f > done > > (note the redirection is opposite!, and read was changed to write!). > > Now, try to assemble the array - it should be here. We just moved > (actually copied) the superblock from the now-middle-of-partitions > to the end, where it should be, and mdadm is now able to find it. > The array is still of the old size - but now mdadm --grow will > work. > > That's basically it. Just watch the mdsuper invocation. > > /mjt > -- > 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 -- Regards Wayne Gemmell Flash Media Group Tel: 27 (0)12 430 7597 Cell: 27 (0)83 666 3342 ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Online resize 2008-03-12 8:04 ` Michael Tokarev 2008-03-12 9:14 ` Wayne Gemmell @ 2008-03-12 9:31 ` Robin Hill 1 sibling, 0 replies; 13+ messages in thread From: Robin Hill @ 2008-03-12 9:31 UTC (permalink / raw) To: linux-raid [-- Attachment #1: Type: text/plain, Size: 1221 bytes --] On Wed Mar 12, 2008 at 11:04:56AM +0300, Michael Tokarev wrote: > Robin Hill wrote: >> What version metadata are you using? I'm not sure how 1.0 will handle >> partition resizes but any other should certainly be okay. Have you >> tried running mdadm -E on each of the component partitions? I assume >> the new partitions are starting from the same position as the old ones? > > Robin, you're completely wrong here. > > Only metadata at the START of the partition will work here. Which is > either 1.1 or 1.2, but NOT 1.0 or 0.90, - which is at the END of the > partition. When the end of the partition goes away, the superblock > becomes "orphan" somewhere inside the partition, and can't be found > anymore. > That's why I said I wasn't sure about 1.0 metadata. I've grown 0.90 arrays in exactly this way (though I may not actually have rebooted) so I assumed they'd work okay (and the manual doesn't specify where the metadata is for these). Cheers, Robin -- ___ ( ' } | Robin Hill <robin@robinhill.me.uk> | / / ) | Little Jim says .... | // !! | "He fallen in de water !!" | [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Online resize 2008-03-11 9:19 Online resize Wayne Gemmell 2008-03-11 11:12 ` Robin Hill @ 2008-04-29 1:00 ` Neil Brown 2008-04-29 7:30 ` Wayne Gemmell 1 sibling, 1 reply; 13+ messages in thread From: Neil Brown @ 2008-04-29 1:00 UTC (permalink / raw) To: wayne; +Cc: linux-raid On Tuesday March 11, wayne@flashmedia.co.za wrote: > Hi all > > I'd like to do an online resize for my RAID5 drives now that I've upgraded > them to 500GB drives. Now I'm a bit stuck. I assume the steps would be the > following. What exactly do you mean by "now that I've upgraded them to 500GB drives". Don't tell my you got new 500GB drives, created little partitions on them to match the old drives, and added those to the array. That is the wrong way around. md is quite happy having using some partitions much larger than others. So if you have an array with (say) 4 200GB drives and want to replace them all with 500GB drives, you should make 500GB partitions on those drives (assuming that you really want to use partitions) and then one at a time, fail a working drive and add a new drive, and wait for recovery to complete. Once that is done you still have a working array of the same size as before but all the devices (and all the partitions) are larger. Then just mdadm --grow /dev/mdX --size=max and the array will resync the new space and be larger for you. Then you can resize the filesystem. NeilBrown ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Online resize 2008-04-29 1:00 ` Neil Brown @ 2008-04-29 7:30 ` Wayne Gemmell 0 siblings, 0 replies; 13+ messages in thread From: Wayne Gemmell @ 2008-04-29 7:30 UTC (permalink / raw) To: linux-raid On Tuesday 29 April 2008 03:00:13 Neil Brown wrote: > On Tuesday March 11, wayne@flashmedia.co.za wrote: > > Hi all > > > > I'd like to do an online resize for my RAID5 drives now that I've > > upgraded them to 500GB drives. Now I'm a bit stuck. I assume the steps > > would be the following. > > What exactly do you mean by "now that I've upgraded them to 500GB > drives". > Don't tell my you got new 500GB drives, created little partitions on > them to match the old drives, and added those to the array. That is > the wrong way around. That sounds about the way I did it. Since the hdd were so much bigger than the original drives I managed tho fit all 6 partitions on 2 hdd. Then created a new raid and copied everything across. Deleted the 6 partitions and grew the raid to fit the next 2 hdd. Your way sounds easier.... -- Regards Wayne -- 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] 13+ messages in thread
end of thread, other threads:[~2008-04-29 7:30 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-03-11 9:19 Online resize Wayne Gemmell 2008-03-11 11:12 ` Robin Hill 2008-03-11 12:44 ` Wayne Gemmell 2008-03-11 14:58 ` Robin Hill 2008-03-12 7:27 ` Wayne Gemmell 2008-03-12 7:46 ` Wayne Gemmell 2008-03-12 8:04 ` Michael Tokarev 2008-03-12 9:14 ` Wayne Gemmell 2008-03-12 9:38 ` Michael Tokarev 2008-03-12 11:17 ` Wayne Gemmell 2008-03-12 9:31 ` Robin Hill 2008-04-29 1:00 ` Neil Brown 2008-04-29 7:30 ` Wayne Gemmell
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).