
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kolbu &#187; raid sets</title>
	<atom:link href="http://www.kolbu.com/tag/raid-sets/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kolbu.com</link>
	<description>Computers, Gadgets and Beyond!</description>
	<lastBuildDate>Sun, 09 Oct 2011 17:44:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Growing RAID5 sets in Ubuntu</title>
		<link>http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/</link>
		<comments>http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/#comments</comments>
		<pubDate>Wed, 10 Jan 2007 17:44:32 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[growing]]></category>
		<category><![CDATA[raid sets]]></category>
		<category><![CDATA[raid5]]></category>

		<guid isPermaLink="false">http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/</guid>
		<description><![CDATA[Growing RAID5 sets under Linux by adding new disks on the fly has been possible for some time now. However, the kernel that comes default with Ubuntu 6.10 does not appear to contain all the needed support to do this. So if you need to do this, as I did, you first need to boot [...]<p>a</p>
]]></description>
			<content:encoded><![CDATA[<p>Growing RAID5 sets under Linux by adding new disks on the fly has been possible for some time now. However, the kernel that comes default with Ubuntu 6.10 does not appear to contain all the needed support to do this. So if you need to do this, as I did, you first need to boot a newer kernel than the one available. I picked 2.6.19 and compiled it using <a href="http://www.howtoforge.com/kernel_compilation_ubuntu">these instructions</a>. That took about five commands in total to do, so I won&#8217;t repeat those instructions here. Note however, that I had to specifically add support for both RAID5 and my various SATA-cards to the kernel configuration (the <strong>make menuconfig</strong> part of the instructions). Your mileage may vary. </p>
<p><span id="more-19"></span><strong><br />Note up front that the procedure is somewhat new and you must either be willing to lose every bit of data on the disk array you are playing around with or made a recent backup. There are absolutely no guarantees here.</strong></p>
<p>You know that your current kernel is too old if you get these kind of error messages when you try to grow your array:</p>
<blockquote><p><strong># mdadm &#8211;grow /dev/md0 &#8211;raid-disks=4</strong><br />mdadm: Cannot set device size/shape for /dev/md0: Invalid argument</p></blockquote>
<p>And maybe also:
</p>
<blockquote><p><strong># mdadm &#8211;grow /dev/md0 &#8211;raid-disks=4</strong><br />
mdadm: /dev/md0: Cannot get array details from sysfs</p></blockquote>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Once running the newer kernel however, this is how I did it. Current setup is one RAID5 array with 6 disks.</p>
<blockquote><p>&nbsp;<strong># cat /proc/mdstat </strong><br />Personalities : [raid6] [raid5] [raid4] <br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br />md0 : active raid5 sda[0] sdf[5] sde[4] sdd[3] sdc[2] sdb[1]<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1465180480 blocks level 5, 32k chunk, algorithm 2 [6/6] [UUUUUU]</p>
</blockquote>
<p>&nbsp;Adding a disk to the array will cause it to be tagged as a spare, only to be used if one of the existing disks fail:</p>
<blockquote><p>&nbsp;<strong># mdadm &#8211;add&nbsp; /dev/md0 /dev/sdg</strong><br />mdadm: added /dev/sdg<br /><strong># cat /proc/mdstat</strong> <br />Personalities : [raid6] [raid5] [raid4] </p>
<p>md0 : active raid5 sdg[6](S) sda[0] sdf[5] sde[4] sdd[3] sdc[2] sdb[1]<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1465180480 blocks level 5, 32k chunk, algorithm 2 [6/6] [UUUUUU]</p>
</blockquote>
<p>And now for the critical part, telling the raid set to convert the spare into a working part of the array. The way this is done is with the &#8211;grow argument and telling the array how many disks the array will be made up of after the insertion. Since we had 6 disks to begin with, the new number is 7.<br />&nbsp;</p>
<blockquote><p><strong># mdadm &#8211;grow /dev/md0 &#8211;raid-disks=7</strong><br />mdadm: Need to backup 960K of critical section..<br />mdadm: &#8230; critical section passed.<br /><strong># cat /proc/mdstat </strong><br />Personalities : [raid6] [raid5] [raid4] </p>
<p>md0 : active raid5 sdg[6] sda[0] sdf[5] sde[4] sdd[3] sdc[2] sdb[1]<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1465180480 blocks super 0.91 level 5, 32k chunk, algorithm 2 [7/7] [UUUUUUU]<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&gt;....................]&nbsp; reshape =&nbsp; 0.0% (49804/293036096) finish=489.2min speed=9960K/sec</p></blockquote>
<p>Piece of cake, and as you can see our array has started to incorporate the new disk into the array. This takes a long time, since it has to rewrite the existing data across the existing disks and the new one. </p>
<p>After that is done, we need to expand the actual file system to fill the new, larger device we&#8217;ve just extended.&nbsp; How to do this depends greatly on what file system you have of course. I&#8217;ll show one ext2/ext3 method here, but check out the <a target="_blank" href="http://tldp.org/HOWTO/LVM-HOWTO/extendlv.html">LVM HOWTO</a> for information about how to deal with the other types.</p>
<p>&nbsp;Note that there is a way of resizing an ext2/ext3 file system without unmounting, but we&#8217;ll do it the safe way here:</p>
<blockquote><p># umount /dev/md0<br /># ext2resize /dev/md0<br />ext2resize v1.1.19 &#8211; 2001/03/18 for EXT2FS 0.5b<br /># mount /dev/md0</p>
</blockquote>
<p>The ext2resize also takes forever on a large file system, in the order of several hours. So be patient. <br />&nbsp;</p>
<p>There, that&#8217;s it. </p>
<p></p>
<p>&nbsp;</p>
<p>a</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/&amp;title=Growing+RAID5+sets+in+Ubuntu" title="Add 'Growing RAID5 sets in Ubuntu' to Del.icio.us"><img src="http://www.kolbu.com/wp-content/plugins/social-bookmarking-reloaded/delicious.png" title="Add 'Growing RAID5 sets in Ubuntu' to Del.icio.us" alt="Add 'Growing RAID5 sets in Ubuntu' to Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/&amp;title=Growing+RAID5+sets+in+Ubuntu" title="Add 'Growing RAID5 sets in Ubuntu' to digg"><img src="http://www.kolbu.com/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'Growing RAID5 sets in Ubuntu' to digg" alt="Add 'Growing RAID5 sets in Ubuntu' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/" title="Add 'Growing RAID5 sets in Ubuntu' to Technorati"><img src="http://www.kolbu.com/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'Growing RAID5 sets in Ubuntu' to Technorati" alt="Add 'Growing RAID5 sets in Ubuntu' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/&amp;t=Growing+RAID5+sets+in+Ubuntu" title="Add 'Growing RAID5 sets in Ubuntu' to Yahoo My Web"><img src="http://www.kolbu.com/wp-content/plugins/social-bookmarking-reloaded/yahoo_myweb.png" title="Add 'Growing RAID5 sets in Ubuntu' to Yahoo My Web" alt="Add 'Growing RAID5 sets in Ubuntu' to Yahoo My Web" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/&amp;title=Growing+RAID5+sets+in+Ubuntu" title="Add 'Growing RAID5 sets in Ubuntu' to Stumble Upon"><img src="http://www.kolbu.com/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'Growing RAID5 sets in Ubuntu' to Stumble Upon" alt="Add 'Growing RAID5 sets in Ubuntu' to Stumble Upon" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/&amp;title=Growing+RAID5+sets+in+Ubuntu" title="Add 'Growing RAID5 sets in Ubuntu' to Google Bookmarks"><img src="http://www.kolbu.com/wp-content/plugins/social-bookmarking-reloaded/google.png" title="Add 'Growing RAID5 sets in Ubuntu' to Google Bookmarks" alt="Add 'Growing RAID5 sets in Ubuntu' to Google Bookmarks" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="https://favorites.live.com/quickadd.aspx?url=http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/&amp;title=Growing+RAID5+sets+in+Ubuntu" title="Add 'Growing RAID5 sets in Ubuntu' to Live-MSN"><img src="http://www.kolbu.com/wp-content/plugins/social-bookmarking-reloaded/live.png" title="Add 'Growing RAID5 sets in Ubuntu' to Live-MSN" alt="Add 'Growing RAID5 sets in Ubuntu' to Live-MSN" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=Growing+RAID5+sets+in+Ubuntu&amp;url=http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/" title="Add 'Growing RAID5 sets in Ubuntu' to SlashDot"><img src="http://www.kolbu.com/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'Growing RAID5 sets in Ubuntu' to SlashDot" alt="Add 'Growing RAID5 sets in Ubuntu' to SlashDot" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></content:encoded>
			<wfw:commentRss>http://www.kolbu.com/2007/01/10/growing-raid5-sets-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

