<?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>lummie.co.uk &#187; 2 disks</title>
	<atom:link href="http://lummie.co.uk/tag/2-disks/feed/" rel="self" type="application/rss+xml" />
	<link>http://lummie.co.uk</link>
	<description>Code, Apps, Thoughts &#38; Dribble</description>
	<lastBuildDate>Tue, 12 Jan 2010 14:39:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ubuntu Server &#8211; Creating an expandable Raid5 Array starting with 2 disks</title>
		<link>http://lummie.co.uk/ubuntu-server-creating-an-expandable-raid5-array-starting-with-2-disks/</link>
		<comments>http://lummie.co.uk/ubuntu-server-creating-an-expandable-raid5-array-starting-with-2-disks/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 15:28:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[2 disks]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[raid5]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ubuntu server]]></category>

		<guid isPermaLink="false">http://lummie.co.uk/?p=263</guid>
		<description><![CDATA[Again, I&#8217;m using VirtualBox to test this, I have a single OS drive with Ubuntu Server (intrepid) installed. I&#8217;ve added two 2gb virtual disk to it, which will be the starting point of the Raid5.  Most places on the net say you need at least 3 disks to run raid 5, but let&#8217;s see what [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-234" src="http://lummie.co.uk/files/2009/02/raid.jpg" alt="raid" width="116" height="116" />Again, I&#8217;m using VirtualBox to test this, I have a single OS drive with Ubuntu Server (intrepid) installed. I&#8217;ve added two 2gb virtual disk to it, which will be the starting point of the Raid5.  Most places on the net say you need at least 3 disks to run raid 5, but let&#8217;s see what happens.</p>
<p>Lets create the raid:</p>
<pre>mdadm --create /dev/md0 --level=5 --raid-devices=2 /dev/sdb /dev/sdc</pre>
<p>The raid gets created! and we can monitor it with</p>
<pre>cat /proc/mdstat</pre>
<p>When it has finished intitialising, create a file system on the raid array (ext3):</p>
<pre>mke2fs -j /dev/md0</pre>
<p>create a mount point (/raid) and mount it</p>
<pre>mkdir /raid</pre>
<pre>mount /dev/md0 /raid</pre>
<p><em>df</em> then reports it as having 2Gb free.  Both my VM drives <em>sdb </em>and <em>sdc </em>are 2Gb, so the assumption is it is simply mirroring the data in 2 drive mode.  This is exactly what we want, as when I get a new drive later on, I want to add it to the raid and see an increase in disk space.  So lets test that, shutdown my machine and add a new drive.</p>
<p>Add the drive to the array</p>
<pre>mdadm --manage --add /dev/md0 /dev/sdd</pre>
<p>now when I run <em>cat /proc/mdstat</em> it says there are 3 drives in the arras but sdd is marked (S)</p>
<p>Lets now grow the array</p>
<pre>mdadm --grow --raid-disk=3 /dev/md0</pre>
<p>Watch the progress with cat /proc/mdstat and when complete we can mount it. (adding the 2Gb took about 5 mniutes! eeek! to grow the array).</p>
<p>After completion /proc/mdstat now reports 4gb available, but the file system on the raid still thinks it&#8217;s 2gb.</p>
<p>So let&#8217;s resize it:</p>
<pre>e2fsck -f /dev/md0</pre>
<pre>resize2fs /dev/md0</pre>
<p>Re mount <em>/dev/md0</em> and <em>df </em>now reports 4Gb.</p>
<p>Success.</p>
]]></content:encoded>
			<wfw:commentRss>http://lummie.co.uk/ubuntu-server-creating-an-expandable-raid5-array-starting-with-2-disks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
