<?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>about:benjie &#187; Storage</title>
	<atom:link href="http://www.benjiegillam.com/tag/storage/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benjiegillam.com</link>
	<description>Benjie Gillam&#039;s blog, and home of MythPyWii - probably the best Wii remote (Wiimote) interface to MythTV - see sidebar.</description>
	<lastBuildDate>Tue, 06 Apr 2010 14:14:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>More Partitioning &#8211; RAID6 This Time!</title>
		<link>http://www.benjiegillam.com/2008/04/more-partitioning-raid6-this-time/</link>
		<comments>http://www.benjiegillam.com/2008/04/more-partitioning-raid6-this-time/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 13:28:52 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Disk partitioning]]></category>
		<category><![CDATA[Logical volume management]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[RAID]]></category>
		<category><![CDATA[Storage]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=110</guid>
		<description><![CDATA[Image via Wikipedia I told you about moving my data over to a RAID1+0 and RAID5 system in this previous post, but, as expected, I never got round to finishing it. Until now, that is&#8230; I went to London on business for a few days, and came back to find MythTV had stopped working. The [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; float: right;"><a href="http://commons.wikipedia.org/wiki/Image:RAID_6.svg" target="_blank"><img style="border: medium none; display: block;" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/70/RAID_6.svg/300px-RAID_6.svg.png" alt="RAID 6 with fives disks (disk 0, 1, 2, 3, and 4) and each group of blocks (orange, yellow, green, and blue) have two distributed parity blocks that are distributed across the five disks" /></a>Image via <a href="http://commons.wikipedia.org/wiki/Image:RAID_6.svg" target="_blank">Wikipedia</a></p>
</div>
<p>I told you about moving my data over to a RAID1+0 and <a class="zem_slink" title="Standard RAID levels" rel="wikipedia" href="http://en.wikipedia.org/wiki/Standard_RAID_levels" target="_blank">RAID5</a> system in <a title="How I Converted My 4-disk RAID5 Into A 6-disk Super Storage" href="http://www.benjiegillam.com/2008/04/how-i-converted-my-4-disk-raid5-into-6-disk-super-storage/" target="_blank">this previous post</a>, but, as expected, I never got round to finishing it. Until now, that is&#8230;</p>
<p>I went to London on business for a few days, and came back to find <a class="zem_slink" title="MythTV" rel="homepage" href="http://www.mythtv.org/" target="_blank">MythTV</a> had stopped working. The disk was full, so it had given up, and wouldn&#8217;t even let me get in to view the recordings &#8211; so I couldn&#8217;t even delete some to get it working again! (I wonder why Auto-Expire wasn&#8217;t working.) Anyway, this spurred me on to finally finish partitioning/setting up my drives. The process was quite simple, really. The following steps generally assume you are root already (<tt>sudo su</tt>) because I am a &#8220;bad&#8221; sysadmin and don&#8217;t believe in all this constant <tt>sudo</tt> malarchy. Following my instructions is, as always, at your own risk. I highly recommend that you read the relevant documentation before proceeding (such as <a title="LVM Common Tasks" href="http://tldp.org/HOWTO/LVM-HOWTO/commontask.html" target="_blank">this</a>).</p>
<ol>
<li>Reboot into <a class="zem_slink" title="Ubuntu (Linux distribution)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Ubuntu_%28Linux_distribution%29" target="_blank">Ubuntu</a> <a class="zem_slink" title="LiveCD" rel="wikipedia" href="http://en.wikipedia.org/wiki/LiveCD" target="_blank">LiveCD</a>, don&#8217;t forget to upgrade the software on the LiveCD to prevent any issues!</li>
<li>Disable swapspace (<tt>swapoff /dev/sd[abcd]1</tt>).</li>
<li>Use <a class="zem_slink" title="Cfdisk" rel="wikipedia" href="http://en.wikipedia.org/wiki/Cfdisk" target="_blank"><tt>cfdisk</tt></a> to finish formatting the drives (remembering to change <a class="zem_slink" title="Disk partitioning" rel="wikipedia" href="http://en.wikipedia.org/wiki/Disk_partitioning" target="_blank">partition types</a> to the hexadecimal &#8220;fd&#8221; &#8211; Linux RAID Autodetect). Be careful NOT to modify ANY of the details of the partitions you are already using for data or you will probably lose data!</li>
<li>Reboot back into your real system (not LiveCD &#8211; minimizes downtime).</li>
<li>Optional: add hot spares to current RAID5 devices (<tt>mdadm /dev/md1 -a /dev/sdf5</tt>).</li>
<li>Create the new RAID6 devices (<tt><a class="zem_slink" title="Mdadm" rel="homepage" href="http://neil.brown.name/blog/mdadm" target="_blank">mdadm</a> -C /dev/md3 -l6 -n6 /dev/sd[abcdef]7</tt>).</li>
<li>Optional: wait for the devices to finish resyncing (<tt>watch cat /proc/mdstat</tt>).</li>
<li>Turn the new RAID devices into <a class="zem_slink" title="Logical Volume Manager (Linux)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29" target="_blank">LVM</a> physical volumes (<tt>pvcreate /dev/md3</tt>).</li>
<li>Stop any services that depend on <tt>/data</tt> (<tt>/etc/init.d/mythtv-backend stop; /etc/init.d/mpd stop</tt>).</li>
<li>Unmount the data drive (<tt>umount /data</tt>).</li>
<li>Add the new physical volumes to the current LVM volume group, &#8220;<tt>raid5</tt>&#8221; (<tt>vgextend raid5 /dev/md3</tt>).</li>
<li>Expand the logical volume to the full size of the volume group (use <tt>pvdisplay</tt> to find out the size [411.05GB], and then run <tt>lvextend -L+411.05G /dev/raid5/data</tt>).</li>
<li>Expand the filesystem [ext3] to the full size of the logical volume (<tt>e2fsck -f /dev/raid5/data; resize2fs /dev/raid5/data</tt>) &#8211; running <tt>e2fsck</tt> on a 600GB drive does take a while&#8230; Took about 30 minutes for me with little else running.</li>
<li>Remount the data drive (<tt>mount /data</tt>).</li>
<li>Restart the services you stopped eariler (<tt>/etc/init.d/mythtv-backend start; /etc/init.d/mpd start</tt>).</li>
<li>Remember to update (I prefer to re-create) your initramfs and update grub (<tt>update-initramfs -k all -c; update-grub</tt>)</li>
<li>All done!</li>
</ol>
<p>I chose RAID6 over 6 disks over RAID5 over 5 disk with one hot spare because it has better redundancy and similar performance. It was added to the kernel at the end of 2003 so I think it should be fairly stable by now.</p>
<p>This process was not too complicated, and all of this can be done with very little downtime (if you are clever/daring, you can even re-partition without rebooting, but that was too risky for me!). You can even do the LVM stuff without taking <tt>/data</tt> offline! I wouldn&#8217;t advise it though.</p>
<p>If this post helps you, please let me know in the comments.</p>
<div id="zemanta-pixie" style="margin: 5px 0pt; width: 100%;"><a id="zemanta-pixie-a" title="Zemified by Zemanta" href="http://www.zemanta.com/"><img id="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/pixie.png?x-id=c1f2a54a-8755-4070-86a4-570f4d43bc13" alt="" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2008/04/more-partitioning-raid6-this-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
